Looking for a recommendation to decode xml-data [probably from sql server]

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi !
I lost all my [small] xml experience from the past and now, I have
a xml result, which I have to put into a CSV file.
The xml - I get this via web-request - is like this {using [] backets instead of the usual greater/smaller symbols}:
[events xmlns:sql="urn:schemas-microsoft-com:xml-sql"]
[row last="2012-06-15T13:43:48.260" sum="32" max=".10"/]<br/>
<br/>
[Event Id="E-AFAD129E-AE10-4BC6-96C0-F9DB2BA6664E" dt="2012-06-15T13:39:49" max=".06"]<br/>
[location name="FF-ZZ-333" state="auto" max=".06" x=".03" y=".02" z=".06"/]<br/>
[/Event]<br/>
<br/>
[Event Id="E-E7407E75-0A19-48F6-BD24-C5A5536FB25A" dt="2012-06-15T13:32:17" max=".07"]<br/>
[location name="FF-ZZ-334" state="auto" max=".07" x=".03" y=".03" z=".07"/]<br/>
[/Event]<br/>
<br/>
[/events]<br/>

I can load this into a dataset and I get three tables [row, event
and location]. This is the problem. In the shown case, the
location is a property of the event, like the Id and so it
does NOT belong to another table. The location is
is shown as an element, the Id as an attribute.

Should I better use XPath to process this data manually?

To see any hints would be great !

Thanks alot!

++mabra


View the full article
 
Back
Top