Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Schema
- This topic has 5 replies, 1 voice, and was last updated 9 years, 2 months ago by
community-content.
-
AuthorPosts
-
-
May 18, 2010 at 5:44 PM #24725
Hi,
Is it possible to create schema for following xml (problem with namespaces):
<Area>
<a:street>
<a:house />
<place>
<Number>1</Number>
</place>
</a:street>
</Area>
Thank you -
May 18, 2010 at 6:53 PM #24726
Hi,
See this tutorial from w3schools about XML namespaces:
http://www.w3schools.com/xml/xml_namespaces.asp
Daniel.
-
May 18, 2010 at 8:59 PM #24727
Yes, you will need 3 schema:
<
xs:schema xmlns:a=“urn:areatype“ elementFormDefault=“qualified“ xmlns:xs=“http://www.w3.org/2001/XMLSchema“>
<xs:import schemaLocation=“.\areatype.xsd“ namespace=“urn:areatype“ />
<xs:element name=“Area“ type=“a:areaType“ />
</xs:schema><
xs:schema xmlns:tns=“urn:areatype“ elementFormDefault=“qualified“ targetNamespace=“urn:areatype“ xmlns:xs=“http://www.w3.org/2001/XMLSchema“>
<xs:import schemaLocation=“.\place.xsd“ />
<xs:complexType name=“areaType“>
<xs:sequence>
<xs:element name=“street“>
<xs:complexType>
<xs:sequence>
<xs:element name=“house“ type=“xs:string“ />
<xs:element ref=“place“ />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema><
xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema“>
<xs:element name=“place“ type=“place“ />
<xs:complexType name=“place“>
<xs:sequence>
<xs:element name=“Number“ type=“xs:string“ />
</xs:sequence>
</xs:complexType>
</xs:schema>These schemas will validate this Xml:
<
Area xmlns:a=“urn:areatype“>
<a:street>
<a:house />
<place>
<Number>1</Number>
</place>
</a:street>
</Area>-
May 18, 2010 at 9:45 PM #24729
Thanks Greg. I actually have more complex xml and it is not well -formed. So, I’m thinking to reassign namespaces in orchestration before sending the message out of BizTalk. Not sure if that will work though.
-
May 18, 2010 at 10:02 PM #24730
If it is not well-formed then it is not Xml, its just a complicated flat file.
Are you sending or receiving this message.
A common practice is to manipulate the message into / out of actual Xml in a custom Decode/Encode component in the pipeline. This way all processing thru BizTalk uses Xml and typed messages.-
May 19, 2010 at 12:33 PM #24749
Thanks Greg. Encoding works great!
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.