HELP ME:XML中的数据显示问题!

Jeroki 2002-05-14 10:17:27
提示信息:
- <ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<?MSSQLError HResult="0x80004005" Source="Microsoft XML Extensions to SQL Server" Description="架构: Order 上丢失的属性定义 (OrderID)"?>
</ROOT>

其他设置均无误,错误在程序中,请大家指教,谢谢!

mytemplate.xml
===================================

<ROOTxmlns:sql="urn:schemas-microsoft-com:xml-sql">
<sql:xpath-querymapping-schema="SampleSchema1.xml">
/Employee
</sql:xpath-query>
</ROOT>


SampleSchema1.xml
=======================================


<?xml version="1.0"?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql">
<ElementType name="Customer" sql:relation="Customers">
<AttributeType name="CustomerID" dt:type="id"/>
<AttributeType name="CompanyName"/>
<AttributeType name="ContactName"/>
<AttributeType name="City"/>
<AttributeType name="Fax"/>
<AttributeType name="Orders" dt:type="idrefs" sql:id-prefix="Ord-"/>
<attribute type="CustomerID"/>
<attribute type="CompanyName"/>
<attribute type="ContactName"/>
<attribute type="City"/>
<attribute type="Fax"/>
<attribute type="Orders" sql:relation="Orders" sql:field="OrderID">
<sql:relationship
key-relation="Customers"
key="CustomerID"
foreign-relation="Orders"
foreign-key="CustomerID"/>
</attribute>
<element type="Order">
<sql:relationship
key-relation="Customers"
key="CustomerID"
foreign-relation="Orders"
foreign-key="CustomerID"/>
</element>
</ElementType>
<ElementType name="Order" sql:relation="Orders">
<Attribute Typename="OrderID" dt:type="id" sql:id-prefix="Ord-"/>
<Attribute Typename="EmployeeID"/>
<Attribute Typename="OrderDate"/>
<Attribute Typename="RequiredDate"/>
<Attribute Typename="ShippedDate"/>
<attribute type="OrderID"/>
<attribute type="EmployeeID"/>
<attribute type="OrderDate"/>
<attribute type="RequiredDate"/>
<attribute type="ShippedDate"/>
<element type="OrderDetail">
<sql:relationship
key-relation="Orders"
key="OrderID"
foreign-relation="[OrderDetails]"
foreign-key="OrderID"/>
</element>
</ElementType>
<ElementType name="OrderDetail" sql:relation="[OrderDetails]"
sql:key-fields="OrderIDProductID">
<AttributeType name="ProductID" dt:type="idref"
sql:id-prefix="Prod-"/>
<AttributeType name="UnitPrice"/>
<AttributeType name="Quantity"/>
<attribute type="ProductID"/>
<attribute type="UnitPrice" sql:field="UnitPrice"/>
<attribute type="Quantity"/>
<element type="Discount" sql:field="Discount"/>
</ElementType>
<ElementType name="Discount" dt:type="string"
sql:relation="[OrderDetails]"/>
<ElementType name="Employee" sql:relation="Employees">
<Attribute Typename="EmployeeID"/>
<Attribute Typename="LastName"/>
<Attribute Typename="FirstName"/>
<Attribute Typename="Title"/>
<attribute type="EmployeeID"/>
<attribute type="LastName"/>
<attribute type="FirstName"/>
<attribute type="Title"/>
</ElementType>
</Schema>


...全文
45 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧