Map, Abstract DataTypes

Home Page Forums BizTalk 2004 – BizTalk 2010 Map, Abstract DataTypes

Viewing 0 reply threads
  • Author
    Posts
    • #15935

      Note to Administrators, Very Sorry for duplicating this Question, I hope this works this time.  

      Hello and thanks for any assistance.

      I'm running into a problem where i need to map a schema with abstract datatypes to another schema with abstract datatypes, in the sample below, you can see that the instance document for the source schema contains the 'PostalOrderAddress' type derived from the 'OrderAddress' type which is based on the 'Address' type.  

      Here is my instance document:

      <?xml version="1.0" encoding="utf-8" ?>
      <ns0:Order Id="Id_0" xmlns:ns0="http://schemas.companyName.com/Order1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <Addresses >
        <Address xsi:type="ns0:PostalOrderAddress" Id="Id_0" FirstName="FirstName_1" LastName="LastName_2" Line1="Line1_3" Line2="Line2_4" City="City_5" PhoneNumber="PhoneNumber_6" EmailAddress="EmailAddress_7" />
       </Addresses>
      </ns0:Order>

      Here is a sample xsd schema:

      <?xml version="1.0" encoding="utf-16"?>
      <xs:schema
       xmlns="http://schemas.companyName.com/Order1"
       xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
       attributeFormDefault="unqualified"
       elementFormDefault="unqualified"
       targetNamespace="http://schemas.companyName.com/Order1"
       version="3.0"
       id="SalesOrder"
       xmlns:xs="http://www.w3.org/2001/XMLSchema">

        <xs:element name="Order" type="Order" />
        <xs:complexType name="Order">
          <xs:sequence>
            <xs:element name="Addresses">
              <xs:complexType>
                <xs:sequence>
                  <xs:element minOccurs="1" maxOccurs="unbounded" name="Address" type="OrderAddress" />
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="Id" type="xs:string" use="required" />
        </xs:complexType>

        <xs:complexType name="OrderAddress" abstract="true">
          <xs:attribute name="Id" type="xs:string" />
          <xs:attribute name="FirstName" type="xs:string" />
          <xs:attribute name="LastName" type="xs:string" />
          <xs:attribute name="Line1" type="xs:string" />
          <xs:attribute name="Line2" type="xs:string" />
          <xs:attribute name="City" type="xs:string" />
          <xs:attribute name="PhoneNumber" type="xs:string" />
          <xs:attribute name="EmailAddress" type="xs:string" />
        </xs:complexType>

        <xs:complexType name="PostalOrderAddress">
          <xs:complexContent mixed="false">
            <xs:restriction base="OrderAddress">
              <xs:attribute name="FirstName" type="xs:string" use="required" />
              <xs:attribute name="LastName" type="xs:string" use="required" />
              <xs:attribute name="Line1" type="xs:string" use="required" />
              <xs:attribute name="City" type="xs:string" use="required" />
            </xs:restriction>
          </xs:complexContent>
        </xs:complexType>

        <xs:complexType name="MobilePhoneDeliveryOrderAddress">
          <xs:complexContent mixed="false">
            <xs:restriction base="OrderAddress">
              <xs:attribute name="PhoneNumber" type="xs:string" use="required" />
            </xs:restriction>
          </xs:complexContent>
        </xs:complexType>

      </xs:schema>

      For this example, let's say that the Source schema and the Destination schema are the same!  How would I configure the map to know that the incoming address type was 'PostalOrderAddress' and then populate the Destination schema as such.   The same would be the same if the address type was 'MobilePhoneDeliveryOrderAddress'.

      For this example, (with the Source schema and the Destination schema being the same), I would need for the output to be the same, likewise if the  xsi:type="ns0:MobilePhoneDeliveryOrderAddress", I would need that relationship to be maintained.
      (Note: Bulk Copy won't work as in reality the schemas are not identical, I'm just using them as a sample)
       Any help would be appreciated, I'm lost..  Thanks, Steven

       

       

       

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