Click to See Complete Forum and Search --> : Defining an XSD using SQLXML


gopik
December 9th, 2002, 10:59 AM
Iam using SQLXML 3.0, and i have a requirement as follows :

My XML File :

<root>
<PKG PkgID="1" DateTobeArchivedPS="01022002">
<FILE FileName="AIP01_1.bin" LocType="FilePath"></FILE>
</PKG>
</root>

My XSD File:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="PKG" sql:relation="Location" >
<xsd:complexType>
<xsd:attribute name="PkgID" sql:field="PkgID" type="xsd:string"/>
<xsd:attribute name="DateTobeArchivedPS" sql:field="DateToBeArchivedPS" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>

When i use the interface of "XML Bulk Load Object" and trigger execute() method, the above statement updates the elements PkgID and DateToBeArchivedPS into the table "Location".

Actually i want to insert all the four attributes i.e. PkgID, DateToBeArchivedPS, FileName and LocType. But the attributes FileName and LocType belongs to the element FILE. So how should i include the entries in the XSD file so that i can insert them too into my Table "Location".

Hope my question is clear.

Thanks n Reg,
Gops

sksql
March 3rd, 2003, 02:15 PM
Hi Gopik,

Was your problem solved? did u manage to insert records from different elements into one table.

I need to do a similar thing, it would be of great help if you could share your solution or insight into this problem.

Thanks,
SK