Tuesday, 15 July 2014

Parsing XML in C# like JavaScript -



Parsing XML in C# like JavaScript -

i know says best way parse xml in c# utilize xmldocument class , like:

xmlnodelist list = xmldoc.getelementsbytagname('tag');

however, love way javascript encapsulates xml , json, every level of encapsulation within xml or json document can accessed using '.' i.e.:

test.xml

<item> <title>title</title> <desc> <meta>metadata</meta> <content>ipsum lorem</content> </desc> <date>1/1/2013</date> </item>

in javasript parse xml file , assign object, var obj. like:

obj.item[0].title ( 'title' ) obj.item[0].desc.meta ('metadata')

is there c# library can parse xml or have other way?

not same, kind of approach (reading xml dynamic object) similar in spirit:

http://www.codeproject.com/articles/436406/power-of-dynamic-reading-xml-and-csv-files-made-ea

c# xml json parsing

No comments:

Post a Comment