Hi all,
I am new to .NET but have a problem and see two possible directions i
could go, but i do not know which one to take.
Let me explain my problem, i have a webservice which recieves several
large(ish) XML data streams. An example of the XML data:
<asset name="test">
<inputDevice>
<mouse>
<caption>ps/2 compatible mouse</caption>
<numberOfButtons>2</numberOfButtons>
</mouse>
</inputDevice>
<drive>
<CDROMDrive>
<Drive>E:</Drive>
<manufacturer>Sony</manufacturer>
</CDROMDrive>
</drive>
...
...
the format of this xml document is not fixed, in that you cannot rely
on the existance of inputDevice\mouse\caption. ie the leaf nodes are
not pre-determined and fixed and all parents are dynamic.
I want to place this information in three tables:
- an Asset table (containing primarily the name attribute)
- a property table which would describe the structure of the xml
document and the node, e.g. "manufacturer" is a child of "CDRomDrive"
so the "manufacturer" would have a reference to the CDRomDrive record
in the table.
- a value table which would contain the text nodes and references to
their relevant property
SO......
I basically see two ways of getting this end result, i could either
A) In the webservice method which recieves the XML stream, i could use
an XMLStreamReader to make multiple parses of the XML stream, pulling
out Asset info, Properties and finally the values.
B) When the webservice method recieves the XML stream, write this into
a temporary table on SQL2000 and then fire a stored procedure using
OPENXML to pull out all the relevant info.
C) Something much better i do not know about.
SO......
Which of the above routes are going to be the most easy or efficient
way of getting this info into the Database without locking up my web
service.
thanks very much in advance
Gav