3

我正在尝试将 XSD 映射到另一个在 Smooks 中有一些不同元素的 XSD。当我在 Smooks 中添加两个 XSD 时,它不允许我映射元素。在 Smooks 中是否可以映射两个不同的 XSD?

XSD1:CDM

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:RequestResponse="http://example.com/cdm/xsd/Person_01_RequestResponse_001" 
xmlns:prsn="http:/example.com/cdm/xsd/Person_01" 
attributeFormDefault="unqualified" elementFormDefault="qualified" 
targetNamespace="http://example.com/cdm/xsd/Person_01_RequestResponse_001"> 

    <!-- ************ import Employee Model ************ -->

    <xs:import namespace="http://example.com/cdm/xsd/Person_01" schemaLocation="Person_01.xsd"/>

    <!-- ********************************************* -->
    <!--            Request Response Types             -->
    <!-- ********************************************* -->



    <!-- For CreatePerson operation-->

    <xs:element name="CreatePersonRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="PersonDetail" type="prsn:Person"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="CreatePersonResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ResponseCode" type="xs:string"/>
                <xs:element name="ResponseMessage" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- For GetPerson operation-->

    <xs:element name="GetPersonRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="PersonId" type="prsn:PersonIdType" nillable="false"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="GetPersonResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Person" type="prsn:Person" minOccurs="0" nillable="true"/>                
                <xs:element name="ResponseCode" type="xs:string"/>
                <xs:element name="ResponseMessage" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>

XSD2:遗产

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:RequestResponse="http://example.com/xsd/Person_01_RequestResponse_001" 
xmlns:prsn="http://example.com/xsd/Person_01" 
attributeFormDefault="unqualified" elementFormDefault="qualified" 
targetNamespace="http://example.com/xsd/Person_01_RequestResponse_001"> 

    <!-- ************ import Employee Model ************ -->

    <xs:import namespace="http://example.com/xsd/Person_01" schemaLocation="Person_01.xsd"/>

    <!-- ********************************************* -->
    <!--            Request Response Types             -->
    <!-- ********************************************* -->



    <!-- For CreatePerson operation-->

    <xs:element name="CreatePersonRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="PersonDetail" type="prsn:Person"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="CreatePersonResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ResponseCode" type="xs:string"/>
                <xs:element name="ResponseMessage" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- For GetPerson operation-->

    <xs:element name="GetPersonRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="CNIC" type="xs:string" nillable="false" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="GetPersonResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Person" type="prsn:Person" minOccurs="0" nillable="true"/>                
                <xs:element name="ResponseCode" type="xs:string"/>
                <xs:element name="ResponseMessage" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- For UpdatePerson operation-->

    <xs:element name="UpdatePersonRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Person" type="prsn:Person"/>              
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="UpdatePersonResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ResponseCode" type="xs:string"/>
                <xs:element name="ResponseMessage" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- For deletePerson operation-->

    <xs:element name="DeletePersonRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="CNIC" type="xs:string" nillable="false" minOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="DeletePersonResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ResponseCode" type="xs:string"/>
                <xs:element name="ResponseMessage" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>


</xs:schema>
4

0 回答 0