Window .Net Service

J

jjmraz

Hi,


Heres the scenario: I have a couple of xml feeds coming in from
another company. I would have a window service to check every so
often for these xml files. The service would parse the xml data out
and check it against our database and maybe add some things to a new
xml file to be sent out. So in the parsing of the xml file to weed out
the data. I would
assume the best way to approach this is to use xslt/xpath for
extraction? Anybody have any examples in using xslt to extract data
from an xml file in c# ?


Thanks,

JJ
 
G

Guest

Actually, if you know the structure of the Xml "file" in advance, I'd be more
inclined to write a class that does my extraction automatically. In fact, you
may even be able to supply a schema (or even without one) load the Xml into a
DataSet using its ReadXml method. Just my 2 cents though.
Peter
 
K

Kevin Spencer

A lot of it depends on what *kind* of XML file it is. After all, the 'X' in
XML stands for "eXtensible." There are .Net classes to handle most of the
common types of XML files, literally hundreds of them. Can you shed some
light on what sort of XML it is?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
D

Dan Bass

JJ,

The first thing I'd do is to load the XML into an XmlDocument object.

There's a command on this object called "SelectSingleNode" (returns an
XmlNode object) and another called "SelectNodes" (returns an XmlNodeList
object). Both of these methods allow you to specify an XPath.

Try googling these and see what you come up with. If you need more help,
as has already been suggested, then give us an example of the XML you're
evaluating, and what you're looking to do with it.

Thanks.

Dan.
 

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