0
我想使用sqlxml批量加載器將大型xml文件加載到db。爲了做到這一點,我們必須更新模式文件。下面是schema文件:xsd架構不會正確處理文件xml
<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
xmlns="http://www.eagleinvsys.com/2011/EagleML-2-0" >
<xsd:element name="EagleML"
xsi:type="WarehouseTransactionMessage"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
sql:is-constant="1" >
<xsd:complexType >
<xsd:sequence>
<!--<xsd:element name="header" sql:is-constant="1" />
<xsd:element name="taskIdentifier" sql:is-constant="1" />-->
<xsd:element name="warehouseTransaction" sql:is-constant="1">
<xsd:complexType >
<xsd:sequence>
<xsd:element name="warehouseOpenLot" sql:relation="TEST" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="accountingBasis" type="xsd:string" />
</xsd:sequence>
<!--<xsd:attribute name="accruedLtdBase" type="xsd:decimal" />
<xsd:attribute name="accruedLtdLocal" type="xsd:decimal" />-->
<!--<xsd:attribute name="xrateLocalBase" type="xsd:decimal" />-->
<!--<xsd:attribute name="buySellFlag" type="xsd:normalizedString" />
<xsd:attribute name="closeTipsIncomeLtdBase" type="xsd:decimal" />-->
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
這裏是XML文件
<EagleML
eaglemlVersion="2-0"
eaglemlType="WarehouseTransactionMessage"
eaglemlRevision="263"
xsi:schemaLocation="http://www.eagleinvsys.com/2011/EagleML-2-0 eagleml-main-2-0.xsd"
xsi:type="WarehouseTransactionMessage"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.eagleinvsys.com/2011/EagleML-2-0"
>
<header>
<messageId>B70JFJ55EE9AVXOX</messageId>
<sentBy>http://www.eagleinvsys.com/</sentBy>
<creationTimestamp>2017-09-25T08:25:54-04:00</creationTimestamp>
</header>
<taskIdentifier>
<correlationId>JFJ55EE9TARJH009</correlationId>
<sequenceNumber>1</sequenceNumber>
</taskIdentifier>
<warehouseTransaction>
<header>
<objectType>WarehouseOpenLot</objectType>
</header>
<warehouseOpenLot>
<accountingBasis>USTAX</accountingBasis>
</warehouseOpenLot>
<warehouseOpenLot>
<accountingBasis>TESTT</accountingBasis>
</warehouseOpenLot>
</warehouseTransaction>
</EagleML>
如果要是將這些標籤功能,它工作正常,但我沒有這樣做的奢侈品:
xsi:schemaLocation="http://www.eagleinvsys.com/2011/EagleML-2-0 eagleml-main-2-0.xsd"
xsi:type="WarehouseTransactionMessage"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.eagleinvsys.com/2011/EagleML-2-0"
我在這裏做錯了什麼?我嘗試將這些標籤移動到EagleML元素中,但我似乎仍然無處可尋。有沒有人看到這個錯誤?