以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  使用sqlxml3.0将xml数据导入数据库的问题--根据已知xml文件分析它的架构  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=18768)


--  作者:huangrui372
--  发布时间:5/24/2005 11:17:00 AM

--  使用sqlxml3.0将xml数据导入数据库的问题--根据已知xml文件分析它的架构
我的xml文件--SampleXMLData1.xml
<?xml version="1.0" encoding="GBK" ?>
<SCHEMA NAME="FJWZFPCGL" CHSNAME="废旧物资发票开具清单"
 SSSQ="200502" CRC="FJWZFPCGL200502_1361001_CRC.XML">
 <SWJG SWJGID="1361001" SWJGMC="**市国家税务局直属税务分局" HZRQ="2005-03-11" RECORDCOUNT="10">
  <TAXPAYER SWSBH="361001731965527" NSRMC="**市物资再生利用有限公司" SBRQ="2005-03-02" RECORDCOUNT="6"
   CJLX="DKZK" CJRDM="361001731965527" CJRMC="**市物资再生利用有限公司">
   <Records>
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0105951" KPRQ="2005-02-21" GHFSWSBH="361002162560297"
     FPJE="32800" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0105952" KPRQ="2005-02-21" GHFSWSBH="361024162763852"
     FPJE="43000" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0105953" KPRQ="2005-02-25" GHFSWSBH="361002162560297"
     FPJE="36120" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0105954" KPRQ="2005-02-25" GHFSWSBH="361001748519865"
     FPJE="31200" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0105956" KPRQ="2005-02-26" GHFSWSBH="361027759973609"
     FPJE="69000" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0105957" KPRQ="2005-02-26" GHFSWSBH="361027759973609"
     FPJE="88550" />
   </Records>
  </TAXPAYER>
  <TAXPAYER SWSBH="361001748523231" NSRMC="**盛昌再生资源有限公司" SBRQ="2005-03-04" RECORDCOUNT="4" CJLX="DKZK"
   CJRDM="361001748523231" CJRMC="**盛昌再生资源有限公司">
   <Records>
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0117326" KPRQ="2005-02-25" GHFSWSBH="361002705789478"
     FPJE="81000" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0117327" KPRQ="2005-02-25" GHFSWSBH="361002705789478"
     FPJE="81000" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0117328" KPRQ="2005-02-25" GHFSWSBH="361002705789478"
     FPJE="38000" />
    <Record GHFNSRLB="1" FPDM="0421091311" FPHM="0117329" KPRQ="2005-02-28" GHFSWSBH="361002162593814"
     FPJE="97736.4" />
   </Records>
  </TAXPAYER>
 </SWJG>
</SCHEMA>
我用工具软件分析了一个schema,
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
           xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

  <xs:element name="SCHEMA">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="SWJG"/>
      </xs:sequence>
      <xs:attribute name="CHSNAME" use="required" type="xs:NCName"/>
      <xs:attribute name="CRC" use="required" type="xs:NCName"/>
      <xs:attribute name="NAME" use="required" type="xs:NCName"/>
      <xs:attribute name="SSSQ" use="required" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="SWJG">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="TAXPAYER"/>
      </xs:sequence>
      <xs:attribute name="HZRQ" use="required" type="xs:NMTOKEN"/>
      <xs:attribute name="RECORDCOUNT" use="required" type="xs:integer"/>
      <xs:attribute name="SWJGID" use="required" type="xs:integer"/>
      <xs:attribute name="SWJGMC" use="required" type="xs:NCName"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="TAXPAYER">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Records"/>
      </xs:sequence>
      <xs:attribute name="CJLX" use="required" type="xs:NCName"/>
      <xs:attribute name="CJRDM" use="required" type="xs:integer"/>
      <xs:attribute name="CJRMC" use="required" type="xs:NCName"/>
      <xs:attribute name="NSRMC" use="required" type="xs:NCName"/>
      <xs:attribute name="RECORDCOUNT" use="required" type="xs:integer"/>
      <xs:attribute name="SBRQ" use="required" type="xs:NMTOKEN"/>
      <xs:attribute name="SWSBH" use="required" type="xs:integer"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Records">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Record"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Record">
    <xs:complexType>
      <xs:attribute name="FPDM" use="required" type="xs:integer"/>
      <xs:attribute name="FPHM" use="required" type="xs:integer"/>
      <xs:attribute name="FPJE" use="required" type="xs:decimal"/>
      <xs:attribute name="GHFNSRLB" use="required" type="xs:integer"/>
      <xs:attribute name="GHFSWSBH" use="required" type="xs:integer"/>
      <xs:attribute name="KPRQ" use="required" type="xs:NMTOKEN"/>
    </xs:complexType>
  </xs:element>
</xs:schema>
运行sqlxml时,弹出错误“’TAXPAYER‘需要关系”
怎么办?


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
4,091.797ms