-1

我有一个包含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 映射。

<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>
4

1 回答 1

0

Google for xsl:choose 和 xsl:element

http://www.w3schools.com/xsl/el_choose.asp

http://www.w3schools.com/XSL/el_element.asp

于 2013-03-26T14:17:14.347 回答