Parsing XML

C

chance

I need to parse this XML

<?xml version = "1.0" encoding="utf-8" ?>
<parms>
<collumn>notice_of_violation.notice_of_violation_id</collumn>
<value>A1000125</value>
</parms>


In particular, I am going to use it to dynamically build a WHERE
clause to be used against my Oracle database.

What I need to figuire out is how to get the type of the node. (Maybe
not using the right language here). For example if I am dealing with a
collumn then I need to also prepend an AND qualifier to my string.

Any help appreciated...
 
M

Martin Honnen

chance said:
I need to parse this XML

<?xml version = "1.0" encoding="utf-8" ?>
<parms>
<collumn>notice_of_violation.notice_of_violation_id</collumn>
<value>A1000125</value>
</parms>

The .NET framework offers a lot of ways to parse XML. The simplest is
XmlReader which offers fast forwards only pull parsing. Then there is
XPathDocument/XPathNavigator which builds an in memory tree model of the
complete XML document and allows XPath navigation/value extraction. Then
there is the .NET DOM implementation with XmlDocument which offers DOM
navigation and XPath navigation and also allows you to make changes and
save them back. Finally you can use XML serialization/deserialization.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top