Link to home
Start Free TrialLog in
Avatar of mr-kenny
mr-kennyFlag for Switzerland

asked on

Put XML attribute values to DataSet most efficiently

How do I put the attached XMLNode output most efficiently to a DataSet?

- Only <rs:data> has to be converted to DataSet
- Every <z:row> tag has to be one DataSet row
- The Attribute names of <z:row> have to be the field names of the DataSet
- The Attribute vales of <z:row> have to be the field values of the DataSet
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"
xmlns="http://schemas.microsoft.com/sharepoint/soap/">
  <rs:data ItemCount="3">
    <z:row ows_Attachments=";#http://verwaltung.mehrlandtechnik.ch/Lists/Occasionen/Attachments/5/Programming Reference.txt;#"
    ows_LinkTitleNoMenu="Test 2" ows_Beschreibung="Text"
    ows_Created="2009-12-18 15:06:13"
    ows_Author="10;#Firstname Lastname"
    ows_Editor="10;#Firstname Lastname" ows_MetaInfo="5;#"
    ows__ModerationStatus="0" ows__Level="1" ows_Title="Test 2"
    ows_ID="5" ows_owshiddenversion="2"
    ows_UniqueId="5;#{605DFE04-59A0-4A79-A99A-6DECB3D62F02}"
    ows_FSObjType="5;#0"
    ows_Created_x0020_Date="5;#2009-12-18 15:06:13"
    ows_FileLeafRef="5;#5_.000"
    ows_FileRef="5;#Lists/Occasionen/5_.000" />
    <z:row ows_Attachments="0" ows_LinkTitleNoMenu="Lorem"
    ows_Beschreibung="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
    ows_Created="2009-12-13 23:45:17"
    ows_Author="10;#Firstname Lastname"
    ows_Editor="10;#Firstname Lastname" ows_MetaInfo="4;#"
    ows__ModerationStatus="0" ows__Level="1" ows_Title="Lorem"
    ows_ID="4" ows_owshiddenversion="1"
    ows_UniqueId="4;#{DF887B7B-ABFC-4C05-B319-B1D6E71C70ED}"
    ows_FSObjType="4;#0"
    ows_Created_x0020_Date="4;#2009-12-13 23:45:17"
    ows_FileLeafRef="4;#4_.000"
    ows_FileRef="4;#Lists/Occasionen/4_.000" />
    <z:row ows_Attachments="0" ows_LinkTitleNoMenu="Test 1"
    ows_Beschreibung="Another description."
    ows_Created="2009-12-13 23:44:57"
    ows_Author="10;#Firstname Lastname"
    ows_Editor="10;#Firstname Lastname" ows_MetaInfo="3;#"
    ows__ModerationStatus="0" ows__Level="1" ows_Title="Test 1"
    ows_ID="3" ows_owshiddenversion="1"
    ows_UniqueId="3;#{71D0B482-446B-4737-9A1F-1C35C5124B7F}"
    ows_FSObjType="3;#0"
    ows_Created_x0020_Date="3;#2009-12-13 23:44:57"
    ows_FileLeafRef="3;#3_.000"
    ows_FileRef="3;#Lists/Occasionen/3_.000" />
  </rs:data>
</listitems>

Open in new window

Avatar of swapneel_d14
swapneel_d14

just do dataset.readxml (filename)
Avatar of mr-kenny

ASKER

Thats's not enough: The DataSet output should consider follwing points:

- Only <rs:data> has to be converted to DataSet
- Every <z:row> tag has to be one DataSet row
- The Attribute names of <z:row> have to be the field names of the DataSet
- The Attribute vales of <z:row> have to be the field values of the DataSet
ASKER CERTIFIED SOLUTION
Avatar of mr-kenny
mr-kenny
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial