English 中文(简体)
• 从XML档案中建立SINGLE XSD化学材料吗?
原标题:Creating a SINGLE XSD schema file from an XML file?
  • 时间:2010-08-08 02:25:05
  •  标签:
  • xml
  • xsd

是否有办法从以下XML档案中只制作一个XSD档案? 我尝试了各种工具,但是它们都制作了多个XSD文件。 WHat是多个XSD档案的起因? 我只需要一个XSD文件装上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>
问题回答

多个XSD档案的起因是,你有两个图形名称空间:

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

这些名称的每一个空间都将在单独的Xsd schema档案中界定——我不了解将这两个图象文件合并的任何方法(即用Xsd schema瞄准多个名称空间)。

有可能将许多图象文件合并成一套图象,尽管你们可能如何使用SSIS I m并不确定。

更简单的解决办法可能是把名称空间结合起来,而不是有两个名称空间。





相关问题
how to represent it in dtd?

I have two element action and guid. guid is a required field when action is add. but when action is del it will not appear in file. How to represent this in dtd ?

.Net application configuration add xml-data

I need to add xml-content to my application configuration file. Is there a way to add it directly to the appSettings section or do I need to implement a configSection? Is it possible to add the xml ...

XStream serializing collections

I have a class structure that I would like to serialize with Xstream. The root class contains a collection of other objects (of varying types). I would like to only serialize part of the objects that ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Merging an XML file with a list of changes

I have two XML files that are generated by another application I have no control over. The first is a settings file, and the second is a list of changes that should be applied to the first. Main ...

How do I check if a node has no siblings?

I have a org.w3c.dom.Node object. I would like to see if it has any other siblings. Here s what I have tried: Node sibling = node.getNextSibling(); if(sibling == null) return true; else ...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

热门标签