Actually, the attribute is not "Address ID", it is only "ID"
associated with the node "Address". you can check the values like :
xmlDocument.SelectSingleNode("//ZipCodeLookupResponse/
Address").Attributes["ID"].Value. and this will give you the value of
that attribute.
Regards,
Yasir Zaheer.
[quoted text, click to view] On Dec 26, 9:06 am, newscorrespond...@charter.net wrote:
> I think I got the answer. The Address ID is an attribute of a node not the
> document which I was originally checking.
My XML knowledge is extreemly limited but learning not quite fast enough!
I am getting some XML back from the USPS web service as a string
<?xml version="1.0"?>
<ZipCodeLookupResponse><Address ID="0"><Address2>6406 IVY
LN</Address2><City>GREENBELT</City><State>MD</State><Zip5>20770</Zip5><Zip4>1440</Zip4></Address></ZipCodeLookupResponse>
I create a System.Xml.XmlDocument and then load the string.
How do I access the value of "Address ID=" from within C# code using the
XMLDocument?
From one of my books I think this is an attribute but when I check it tells
me there are no attributes in the document.
Thanks
Prajem pekný deň.
Potreboval by som vygenerovať funkciou Random
ÄÃslo do nejakej premennej. V praxi by som chcel
vytvoriÅ¥ nejaký prÃklad pre výpoÄet.
Nech som hľadal ako hľadal, ale niÄ som rozumné nenaÅ¡iel.
Nemáte nejaký slušný Netlink, kde by to bolo možné doštudovať?
Dik za pomoc.