开发者

Creating a SINGLE XSD schema file from an XML file?

Is there a way to create just one XSD file from the below XML file? I have tried various tools but they all produce multiple XSD files. WHat is the cause of multiple XSD files? I need just one XSD file to load in SSIS.

<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
    xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
    xmlns:rs='urn:schemas-microsoft-com:rowset'
    xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
    <s:ElementType name='row' content='eltOnly'>
        <s:AttributeType name="c0" rs:name="FIRST_NAME" rs:number="1" rs:nullable="true">
            <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="30"/>
        </s:AttributeType>
        <s:AttributeType name="c1" rs:name="MIDDLE_NAME" rs:number="2" rs:nullable="true">
            <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="30"/>
        </s:AttributeType>
        <s:AttributeType name="c2" rs:name="LAST_NAME" rs:number="3">
            <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="60" rs:maybenull="false"/>
        </s:AttributeType>
        <s:AttributeType name="c3" rs:name="OTHER_ID" rs:number="4" rs:nullable="true">
            <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="24"/>
        </s:AttributeType>
        <s:AttributeType name="c4" rs:name="FS_LUN_CODE_ID" rs:number="5" rs:nullable="true">
            <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="2"/>
        </s:AttributeType>
        <s:AttributeType name="c5" rs:name="FS_NAME_ID_PAYOR" rs:number="6" rs:nullable="true">
            <s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true"/>
        </s:AttributeType>
        <s:AttributeType name="c6" rs:name="FS_TRAN_TIME" rs:number="7" rs:nullable="true">
            <s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true"/>
        </s:AttributeType>
        <s:AttributeType name="c7" rs:name="NAME_ID" rs:number="8">
            <s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true" rs:maybenull="false"/>
        </s:AttributeType>
        <s:AttributeType name="c8" rs:name="FS_TRAN_DATE" rs:number="9" rs:nullable="true">
            <s:datatype dt:type="date" dt:maxLength="6" rs:fixedlength="true"/>
        </s:AttributeType>
        <s:extends type="rs:rowbase"/>
</s:ElementType>
</s:Schema>
<rs:data>
    <z:row c0='SHELLI' c1='A' c2='AANENSON' c3='671590' c4='N' c5='0' c6='32885' c7='12' c8='2007-09-11'/>
    <z:row c0='SHELLI' c1='A' c2='AANENSON' c3='671590' c4='N' c5='0' c6='32885' c7='12' c8='2007-09-11'/>
    <z:row c0='SHELLI' c1='A' c2='AANENSON' c3='671590' c4='N' c5='0' c6='32885' c7='12' c8='2007-09-11'/>
    <z:row c0='SHELLI' c1='A' c2='AANENSON' c3='671590' c4='N' c5='0' c6='32885' c7='12' c8='2007-09-11'/>
    <z:row c0='WILLIAM' c1='' c2='AASEN' c3='916031' c4='N' c5='0' c6='55833' c7='13' c8='2007-07-27'/>
    <z:row c0='WILLIAM' c1='' c2='AASEN' c3='916031' c4='N' c5='0' c6='55833' c7='13' c8='2007-07-27'/>
    <z:row c0='WILLIAM' c1='' c2='AASEN' c3='916031' c4='N' c5='0' c6='55833' c7开发者_高级运维='13' c8='2007-07-27'/>
</rs:data>
</xml>


The cause of the multiple XSD files is that you have two schema namespaces:

uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882
uuid:C2F41010-65B3-11d1-A29F-00AA00C14882

Each one of these namespaces will be defined in a separate xsd schema file - I'm not aware of any way of combining those two schema files (i.e. having an xsd schema target multiple namespaces).

It is possible to combine many schema files into a schema set, although how you might do this using SSIS I'm not sure.

A simpler solution for you might be to combine the namespaces rather than having two namespaces.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜