Parsing information from an XML source (elements, nodes, attributes) using XPath


/ Published in: C#
Save to your folder(s)

The code is run in [LINQPad](http://www.google.com/url?sa=t&source=web&ct=res&cd=1&ved=0CAsQFjAA&url=http%3A%2F%2Fwww.linqpad.net%2F&ei=exUgS-a-KZOotgOs39T9CQ&usg=AFQjCNFw-ZpPkP4je7u9udiur5Wg5us7tQ&sig2=gA-_2y2xnTKzK2A9CVxXfg), which is where the Dump extension method comes from. You can pretend that it just outputs ToString. The input file for this snippet looks like so:





testfpga


test





The output of the snippet is

FpgaFilePath => testfpga
FirmwareFilePath => test

So the snippet pulls out an attribute from the 'setting' element and the content (text between tags) of the 'value' sub-element.

URL: http://www.aspfree.com/index2.php?option=content&task=view&id=2426&pop=1&hide_ads=1&page=0&hide_js=1

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.