Woohoo! I managed to fix that last problem quite easily... Now I've set up my
SQL bits as well and it all works apart from the BULK LOAD caveat: You can't
have an attribute within a constant element.
I've highlighted the problem line below, what can I do about it?
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-
microsoft-com:mapping-schema">
<!-- definition of simple elements -->
<xs:element name="primary" type="xs:string" sql:field="PrimaryCategory" />
<xs:element name="secondary" type="xs:string" sql:
field="SecondaryCategory"/>
<xs:element name="product" type="xs:string" sql:field="ProductURL"/>
<xs:element name="productImage" type="xs:string" sql:field="ImageURL"/>
<xs:element name="short" type="xs:string" sql:field="Description"/>
<xs:element name="retail" type="xs:string" sql:field="Price"/>
<xs:element name="brand" type="xs:string" sql:field="Brand"/>
<!-- definition of attributes -->
<xs:attribute name="currency" type="xs:string" sql:field="Currency"/>
<xs:attribute name="product_id" type="xs:string" sql:field="ProductName"/>
<xs:attribute name="name" type="xs:string" sql:field="SKU"/>
<!-- definition of complex elements -->
<xs:element name="merchandiser" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element name="product" sql:relation="AffiliatesDataLinkShare">
<xs:complexType>
<xs:sequence>
<xs:element name="category" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="primary"/>
<xs:element ref="secondary"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="URL" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="product"/>
<xs:element ref="productImage"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="description" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="short"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="price" sql:is-constant="true">
<xs:complexType>
<xs:sequence>
<xs:element ref="retail"/>
</xs:sequence>
<xs:attribute ref="currency"/> <!-- PROBLEM!!! -->
</xs:complexType>
</xs:element>
<xs:element ref="brand" />
</xs:sequence>
<xs:attribute ref="product_id"/>
<xs:attribute ref="name"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-xml/200904/1 >> Stay informed about: Importing XML feed for SQL BULK load