CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    85

    Defining an XSD using SQLXML

    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

  2. #2
    Join Date
    Mar 2003
    Posts
    1
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured