Friday, February 10, 2012

BULK XML with value=......

Hi,

I have got a problem with the folowing XML

<?xml version="1.0" encoding="UTF-16"?><!DOCTYPE produkte []>

<produkte>

<produkt>
<produktid value="4950065"/>
<kombiniert value="false"/><artnr value="45869"/><kombipr value="false"/><kurztext><![CDATA[<b>Headpart Carbodur</b>]]></kurztext><gewusst_wie value="false"/><internettext><![CDATA[]]></internettext><stlb><![CDATA[]]></stlb><pid value="5955770"/><dxf value=""/><langtext><![CDATA[for 34 966, 34 100]]></langtext><mbild value="" online=""/><stbild value="./images/strich/S4586901.gif" online="./images/strich/online/S4586901.jpg" width="18" height="60"/><swbild value="./images/sw/F4586901.gif" online="./images/sw/online/F4586901.jpg" thumbnails="./images/sw/thumbnails/F4586901.jpg"/><gruppe value="03"/><designlinie value="20"/><prodtyp value="66"/><sge value="17"/><montage value="99"/><zapfstelle value="99"/><linie value="L20"/><design value="99"/><brausen value="01"/><produktliniename><![CDATA[PL_Spare_Parts]]></produktliniename><produktlinienid value="5955768"/><produktlinientext><![CDATA[]]></produktlinientext><ranking value="1"/><pq value="" online=""/><farben><farbe><produktid value="4950065"/><farbname><![CDATA[chrome]]></farbname><schluessel value="000"/><vvs value=""/><pbild value="./images/prod/45869000.gif" online="./images/prod/online/45869000.jpg" thumbnails="./images/prod/thumbnails/45869000.jpg"/><ranking value="0"/><stueckliste value="true"/><preis value="12,33"/><preis2 value=""/></farbe></farben></produkt></produkte>

How Can I access the value in the fields? <produktid value="4950065"/> ?

I have been trying with this schema but productkid doens't work:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

<xsd:element name="produkt" sql:relation="PRODS" >
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="produktid"/>
<xsd:element name="langtext" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="produktid">
<xsd:complexType>
<xsd:attribute name="value" type="xsd:integer" sql:field="produktid"/>
</xsd:complexType>
</xsd:element>

</xsd:schema>

Many thanks

Hi,

You have to specify sql:is-constant="true" on produktid element and sql:field="produktid" on the value attribute.

I hope this helps.

Regards,

Monica

No comments:

Post a Comment