asp.net - How to get a specific XML value from an XML using C#? -


i have below xml as:

<requests xmlresponse="true"> <request response="yes" responsewait="120000" sequence="1" type="fulfillment"> <requestdata>   <printcontrol>ftp</printcontrol>   <user>81df</user>   <documents>     <addresschangeletter>       <documentinfo>         <addresschange addresschangeid="109346" branch="418" lastchangedate="">           <name>aaa novak</name>           <taxid>123123121</taxid>           <oldaddress1>box 216</oldaddress1>           <oldaddress2>nyane 68017</oldaddress2>           <oldaddress3 />           <oldaddress4 />           <newaddress1>p o box 216</newaddress1>           <newaddress2>ceresco ne 68017</newaddress2>           <newaddress3 />           <newaddress4 />           <datechanged>05/08/2013</datechanged>           <accountinfo acctnum="231232311" acctstatuscodes="ix" />         </addresschange>       </documentinfo>     </addresschangeletter>   </documents> </requestdata> 

i wanted name or value under tag "documents". since in above xml, tag under "document" tag "addresschangeletter", therefore, want name. how it.

something along lines of... (it's not perfect, it'll started - google functions i've used working properly):

xmldocument xml = new xmldocument(); xml.load(yourpathgoeshere)  xmlnodelist addressnodes = xml.getelementsbytagname("addresschange");  foreach (xmlnode onenode in addressnodes) {   myvariabletograbnames = onenode["name"].innertext; } 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -