|
|
 |
Re: FN-FORUM: ASP XML question
date posted 1st June 2005 18:08
On 1 Jun 2005 17:17:26 -0000, "Graeme J Sweeney" said:
> On Wed, 1 Jun 2005, Paul Silver wrote:
>
> > Normally I use objXML.getElementsByTagName("C") then
> > xmlAttribsNode.getAttribute("SZ") the thing is, if SZ is missing, it
> > throws an error. So, how do I check if "SZ" exists before I try and get
> > at it?
>
>
>
> Does getAttribute not return null if its not found ?
> What does the API say is returned if the attribute isn't found?
>
>
Just worked out how to do it -
Set ochildNode = objXML.getElementsByTagName("C")
For i = 0 To LoopCount
If Not ochildNode.item(i) Is Nothing Then
Set xmlAttribsNode = ochildNode.item(i)
blah = xmlAttribsNode.getAttribute("SZ")
End If
Next
There's a loop in there as there are (potentially) several 'C' nodes
that I need to access.
Really very easy now I've found it, what a frustrating load of old
balls.
Cheers
Paul
--
Paul Silver - Web Development and Technical Search Engine Optimisation
07813 654285 -- http://www.paulsilver.co.uk
Check your web pages: http://www.spidertest.com
|
 |
|