none
How to identify External Schema in .XSD file in BizTalk RRS feed

  • Question

  • Hi All,
    I have imported .XSD file and i like to know how can i find external schema in this XSD, there are all in 5 XSD's which are correlated.

    Thanks
    Sandeep
    Thursday, December 17, 2009 9:38 AM

Answers

  • Yes. So for example if you have following as your XSD definition:

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://CatchingException.SalesReport" targetNamespace="http://CatchingException.SalesReport" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <b:schemaInfo document_type="Sales Report" version="1.0" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
    <xs:element name="Daily">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Date" type="xs:string" />
    <xs:element name="UnitsSold" type="xs:string" />
    <xs:element name="UnitsRemaining" type="xs:string" />
    <xs:element name="TotalUnits" type="xs:string" />
    <xs:element name="UnitPrice" type="xs:string" />
    <xs:element name="Comments" type="xs:string" />
    <xs:element name="SignedBy" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    the corresponding XML definition would look like as follows:

    <ns0:Daily xmlns:ns0="http://CatchingException.SalesReport">
      <Date>Date_0</Date>
      <UnitsSold>UnitsSold_0</UnitsSold>
      <UnitsRemaining>UnitsRemaining_0</UnitsRemaining>
      <TotalUnits>TotalUnits_0</TotalUnits>
      <UnitPrice>UnitPrice_0</UnitPrice>
      <Comments>Comments_0</Comments>
      <SignedBy>SignedBy_0</SignedBy>
    </ns0:Daily>

    And 'Daily' would be known as the root node of this XML definition.

    Following is very good article about understanding XSD's:
    http://www.15seconds.com/issue/031209.htm 

    • Marked as answer by Sandeep.Handa Tuesday, December 22, 2009 10:31 AM
    Thursday, December 17, 2009 11:22 AM

All replies

  • You must be having <xsd:include> statement that are referring to external schemas. And there sould be an attribute under <xsd:include> calling SchemaLocation defining the location of those XSD's.

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.xyz.com">
    <xsd:include schemaLocation="XYZ.xsd"/>

    Thursday, December 17, 2009 10:14 AM
  • Hi,
    Thanks for your reply.
    so it means the schema which contains <xs:include> statement is the external schema

    Also can i able detect which is the root node ..
    As when i do transform it asks for root node..


    Thanks
    Sandeep
    Thursday, December 17, 2009 11:02 AM
  • Yes. So for example if you have following as your XSD definition:

    <?xml version="1.0" encoding="utf-16"?>
    <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://CatchingException.SalesReport" targetNamespace="http://CatchingException.SalesReport" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <b:schemaInfo document_type="Sales Report" version="1.0" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
    <xs:element name="Daily">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="Date" type="xs:string" />
    <xs:element name="UnitsSold" type="xs:string" />
    <xs:element name="UnitsRemaining" type="xs:string" />
    <xs:element name="TotalUnits" type="xs:string" />
    <xs:element name="UnitPrice" type="xs:string" />
    <xs:element name="Comments" type="xs:string" />
    <xs:element name="SignedBy" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>

    the corresponding XML definition would look like as follows:

    <ns0:Daily xmlns:ns0="http://CatchingException.SalesReport">
      <Date>Date_0</Date>
      <UnitsSold>UnitsSold_0</UnitsSold>
      <UnitsRemaining>UnitsRemaining_0</UnitsRemaining>
      <TotalUnits>TotalUnits_0</TotalUnits>
      <UnitPrice>UnitPrice_0</UnitPrice>
      <Comments>Comments_0</Comments>
      <SignedBy>SignedBy_0</SignedBy>
    </ns0:Daily>

    And 'Daily' would be known as the root node of this XML definition.

    Following is very good article about understanding XSD's:
    http://www.15seconds.com/issue/031209.htm 

    • Marked as answer by Sandeep.Handa Tuesday, December 22, 2009 10:31 AM
    Thursday, December 17, 2009 11:22 AM