BizTalk remove ns0 from populating

I have this schema, when I generate the instance its always giving me ns0 for everything in the beginning. How can I avoid this. I don't need ns0 to be populated ?

<ns0:Root xmlns:ns0="http://Company.Integration.IPM.Schemas.IPM_SR">
 <ns0:req CpnyId="CpnyId_0" VendId="VendId_1" InvcNbr="InvcNbr_2" InvcDate="1999-05-31" ReqAmt="1">
  <ns0:rit CpnyId="CpnyId_0" Acct="Acct_1" Sub="Sub_2" TranAmt="1" Descr="Descr_4">rit_0</ns0:rit> 
  </ns0:req>
  </ns0:Root>

below is my schema

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://Brightstar.Integration.Serengeti.IPM.Schemas.IPM_SR" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="Root">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="req" maxOccurs="unbounded" minOccurs="1">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="rit" maxOccurs="unbounded" minOccurs="1">
								<xs:complexType>
									<xs:simpleContent>
										<xs:extension base="xs:string">
											<xs:attribute type="xs:string" name="CpnyId" use="required"/>
											<xs:attribute type="xs:string" name="Acct" use="required" />
											<xs:attribute type="xs:string" name="Sub" use="optional"/>
											<xs:attribute name="TranAmt" use="required">
												<xs:simpleType>
													<xs:restriction base="xs:decimal"> 
														<xs:minExclusive value="0"/>
													</xs:restriction> 
												</xs:simpleType>
											</xs:attribute>
											<xs:attribute type="xs:string" name="Descr" use="required" />
										</xs:extension>
									</xs:simpleContent>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
						<xs:attribute type="xs:string" name="CpnyId" use="required"/>
						<xs:attribute type="xs:string" name="VendId" use="required"/>
						<xs:attribute type="xs:string" name="InvcNbr" use="required"/>
						<xs:attribute type="xs:date" name="InvcDate" use="required"/>
						<xs:attribute name="ReqAmt" use="required">
							<xs:simpleType>
								<xs:restriction base="xs:decimal"> 
									<xs:minExclusive value="0"/>
								</xs:restriction> 
							</xs:simpleType>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
		<xs:unique name="VendId_InvcNbr">
			<xs:selector xpath="req"/>
			<xs:field xpath="@CpnyId"/>
			<xs:field xpath="@VendId"/>
			<xs:field xpath="@InvcNbr"/>
		</xs:unique>
	</xs:element>
</xs:schema>

June 17th, 2015 7:11pm

Well, what exactly is the problem?

That format, Qualified, is perfectly valid xml.

You can change the Element Form Default value of the <Schema> node to either (Default) or Unqualified and you will only get the root qualified.

Free Windows Admin Tool Kit Click here and download it now
June 17th, 2015 7:26pm

I changed Attribute form Default, Element FormDefault to unqualified, still receiving ns0: before Root. How can I avoid this

<ns0:Root xmlns:ns0="http://Brightstar.Integration.Serengeti.IPM.Schemas.IPM_SR">
 <req CpnyId="CpnyId_0" VendId="VendId_1" InvcNbr="InvcNbr_2" InvcDate="1999-05-31" ReqAmt="1">
  <rit CpnyId="CpnyId_0" Acct="Acct_1" Sub="Sub_2" TranAmt="1" Descr="Descr_4">rit_0</rit> 
  </req>
  </ns0:Root>

June 17th, 2015 7:28pm

That unfortunately is not possible with the tools as they are.

That is still completely valid xml so what exactly is the problem?  If you are dealing with a non-compliant system, you first task is to get them to accept valid Xml.

Understanding that they may be unwilling to change, keep in mind, this is not your problem or a problem with BizTalk.

If you still have to deal with it, the ESB Namespace Remove can probably help you out. If not, let us know what the actual issue is and we can offer some other options.

Free Windows Admin Tool Kit Click here and download it now
June 17th, 2015 8:32pm

The problem what Iam facing is, I have an xslt (.xsl file) mapped from source to destination schema, and this destinTion schema is source for another map. The first map (.xsl file) is generating correct output without ns0, but taking this output as input to schema is failing validation at root node i.e it is requiring ns0 to pass. If Iam adding ns0 , then it is working. So I want to remove that ns0 from schema
June 17th, 2015 9:37pm

While not recommended and the BizTalk Schema Editor will give you a warning, you can create a schema WITHOUT TARGET NAMESPACE. This will ensure that there is no namespace assigned to the generated XML.

Regards.

Free Windows Admin Tool Kit Click here and download it now
June 18th, 2015 3:27am

I think you can deal with mapping with namespace until finishing all your business processes and once you want to send message you can remove namespace by using namespace removal pipeline

https://msdn.microsoft.com/en-us/library/ee250047%28v=bts.10%29.aspx?f=255&MSPPError=-2147217396

You need first to install ESB Toolkit then you can take dll from that sample

Then you can add remove namespace component to your send pipeline.

June 18th, 2015 3:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics