Get XML node attribute?

Get XML node attribute?

am 02.03.2007 21:17:30 von Pupkin

Hi,

I'm pretty new to XML, but I've been working mostly successfully with an
RSS-parsing bit of ASP code to display the contents of an XML on a web
page.

What I can't seem to find, even though it seems like it should be pretty
elementary, is how, instead of displaying the node text, you can display
the value of a node attribute.

I tried to replace child.text with child.attributename but I get an
error:

Object doesn't support this property or method: 'attributename'

I'm sure this is some simple syntax, but I haven't found it yet.

Any help?

Thanks.

Re: Get XML node attribute?

am 02.03.2007 23:30:57 von Brian Staff

> I tried to replace child.text with child.attributename but I get an
> error:

try this:

child.getAttribute("attributename")

http://www.devguru.com/Technologies/xmldom/quickref/xmldom_m ethods.html

Brian

Re: Get XML node attribute?

am 03.03.2007 00:48:33 von Pupkin

In article , Brian Staff
says...
> > I tried to replace child.text with child.attributename but I get an
> > error:
>
> try this:
>
> child.getAttribute("attributename")
>


Thanks. Figured it was something easy like that.

I even Googled: asp XMLHTTP get node attribute
but came up with nothing.