[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] Access the IXMLDOMNode's "attribute" property
- From: Jim Ancona <scarhill@yahoo.com>
- To: "Stephan van Ingen, thuis" <stephan.van.ingen@advalvas.be>,xml-dev@lists.xml.org
- Date: Fri, 12 Oct 2001 09:19:19 -0700 (PDT)
I ran essentially the same script, and it worked fine. Here's my version
(test1.asp):
<%
' Load XML
set objXML = Server.CreateObject("MSXML2.DOMDocument")
objXML.async = False
objXML.load Server.MapPath("myXml.xml")
Response.Write objXML.documentElement.attributes.length
Response.Write aTree(objXML.documentElement)
function aTree(pNode)
if pNode.attributes.length>0 then
aTree = "<br>pNode.attributes.length is not zero"
end if
end function
%>
Can't see why yours wouldn't work.
Jim
--- "Stephan van Ingen, thuis" <stephan.van.ingen@advalvas.be> wrote:
> When I go to a element with this code:
> ' Load XML
> set objXML = Server.CreateObject("MSXML2.DOMDocument")
> objXML.async = False
> objXML.load Server.MapPath("curprijs.xml")
>
> Then I can see number of attributes with this command for example (FIRST
> ACCESS):
> Response.Write objXML.documentElement.attributes.length
>
> But if I send the object to a function doing this…:
> Response.Write aTree(objXML.documentElement)
>
> … where aTree is a function like this (SECOND ACCESS):
> function aTree(pNode)
> if pNode.attributes.length>0 then
> ‘dosomething
> end if
> …and.so.on…
> end function
>
> ==> Then I get a server ASP-processing error saying: Object required:
> 'pNode.attributes'
>
> Why is this? What is the difference between the FIRST access to the
> attributes-collection and the SECOND?
>
> Any hints would be greatly appreciated!!
>
> Stephan,
>
> Stephan van Ingen
> Boeretangsedreef 29
> 2400 Mol
> +32(0)14/32.68.55 (home)
> +32(0)473/271.584 (cell)
> +32(0)3/218.06.38 (work)
> Stephan.van.Ingen@advalvas.be
> http://www.stephanvaningen.net
>
> --------------------------------------------------------------------------
> The day that Microsoft makes something that doesn't suck is probably the day
> they start making vacuum cleaners.
>
>
=====
Jim Ancona
jim@anconafamily.com jancona@xevo.com
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com