XSLT将源映射到目标

时间:2013-03-26 13:54:47

标签: xslt

我有一个源 personOrBusiness

<xsd:element name="personOrBusiness" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="business"/>
<xsd:enumeration value="person"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

我希望将其映射到FirmOrPerson,知道我应该写什么xslt map。

<element name="ContactParty">
       <complexType>
        <sequence>
         <element name="Language" type="string"/>
         <element name="Service" type="string"/>
         <element name="ContactRole" type="string"/>
         <element name="FirmOrPerson" type="string"/>
         <element name="Address" minOccurs="0">
          <complexType>
           <sequence>
            <element name="Street" type="string"/>
            <element name="HouseNumber" type="int"/>
            <element name="Box" type="string"/>
            <element name="City" type="string"/>
            <element name="ZIPCode" type="int"/>
            <element name="State" type="string"/>
            <element name="Region" type="string"/>
            <element name="Country" type="string"/>
             <element name="isInCityLimit" type="boolean"/>
            </sequence>
          </complexType>
         </element>
         <choice>
          <element name="Firm">
           <complexType>
            <sequence>
             <element name="legalForm" type="string"/>
             <element name="legalName" type="string"/>
             <element name="EnterpriseNumber" type="string"/>
             <element name="NACEcode" type="string"/>
            </sequence>
           </complexType>
          </element>
          <element name="Person">
           <complexType>
            <sequence>
             <element name="Title" type="string"/>
             <element name="LastName" type="string"/>
             <element name="firstName" type="string"/>
             <element name="NationalRegistrationNumber" type="string"/>
              <element name="PhoneType" type="string"/>
              <element name="Phone" type="string"/>
             </sequence>
           </complexType>
          </element>
         </choice>
        </sequence>
       </complexType>
      </element>

1 个答案:

答案 0 :(得分:0)