Last Element of XML file.. How? -
am using asp.net 2.0 , not using linq. possible attribute of last element in xml file. want last elements attribute "articleid" value (4). last number value change each new article added xml file. what's best way read through xml file find last "content" entry , article attribute value.
<blog> <content articleid="1" category="" img="" month="" title="" user="" date="" description="" > </content>g> <content articleid="2" category="" img="" month="" title="" user="" date="" description="" > </content> <content articleid="3" category="" img="" month="" title="" user="" date="" description="" > </content> <content articleid="4" category="" img="" month="" title="" user="" date="" description="" > </content> </blog>
using system.xml; xmldocument xmldoc = new xmldocument(); xmldoc.load("your_xml_file.xml"); xmldoc.documentelement.lastchild.attributes.item(0).value
Comments
Post a Comment