Schema

Viewing 2 reply threads
  • Author
    Posts
    • #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

    • #24726

      Hi,

       

         See this tutorial from w3schools about XML namespaces:

       

      http://www.w3schools.com/xml/xml_namespaces.asp

       

          Daniel.

       

    • #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>

      • #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.

        • #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.

Viewing 2 reply threads
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.