using System.Net and System.XML Question

using System.Net and System.XML Question

am 26.12.2007 04:41:35 von newscorrespondent

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


6406 IVY
LN
GREENBELTMD207701440



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
Tom Groszko

Re: using System.Net and System.XML Question

am 26.12.2007 04:52:50 von Arne

newscorrespondent@charter.net wrote:
> 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
>
>
>

6406 IVY
> LN
GREENBELTMD207701440

>
> 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?

Try:

doc.SelectSingleNode("//ZipCodeLookupResponse/Address/@ID"). Value

Arne

Re: using System.Net and System.XML Question

am 26.12.2007 04:56:24 von MR. Arnold

wrote in message
news:H3kcj.391$nD7.84@newsfe06.lga...
>
> 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
>
>
>

6406 IVY
> LN
GREENBELTMD207701440

>
>
> 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.
>

It's in VB, but you can do the same thing in C#.

http://developer.yahoo.com/dotnet/howto-xml_vb.html

This may help you too in the future.

http://support.softartisans.com/kbview_675.aspx

I feel your pain. I am working on a C# Web service that is to make contact
with a 3rd party Web service to send/receive XML Documents.

I am learning more about XML than I ever cared to know. :)

Re: using System.Net and System.XML Question

am 26.12.2007 05:06:54 von newscorrespondent

I think I got the answer. The Address ID is an attribute of a node not the
document which I was originally checking.

ASP.NET 2.0 - C# - Generovanie čísla - Random

am 27.12.2007 10:06:20 von belakm

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.
S pozdravom Miloš

Re: ASP.NET 2.0 - C# - Generovanie čísla - Random

am 28.12.2007 02:57:34 von Arne

BELÁK Miloš wrote:
> 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.

You may get more responses if you try post in english.

Arne