[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] Access the IXMLDOMNode's "attribute" property
- From: Wayne Steele <firstname.lastname@example.org>
- To: email@example.com, firstname.lastname@example.org
- Date: Fri, 12 Oct 2001 12:46:57 -0700
This is not really a DOM question, but an MSXML/vbscript/COM question; these
are probably better asked elsewhere.
I don't know what the exact problem is, but having worked extensively with
MSXML, I can say that it seems familiar. I've always been able to work
around it by changing which objects get assigned their own variable and
which ones are merely 'transited' via a series of methods.
For instance, instead of accessing "pNode.attributes.length", try
set atts = pNode.attributes
if ( atts.length ) ...
While you're at it, you can put in an assert that 'atts' is a properly
initialized object. Maybe the 'attributes' property returns a null
>From: "Stephan van Ingen, thuis" <email@example.com>
>Subject: [xml-dev] Access the IXMLDOMNode's "attribute" property
>Date: Fri, 12 Oct 2001 17:18:28 +0200
>When I go to a element with this code:
>' Load XML
>set objXML = Server.CreateObject("MSXML2.DOMDocument")
>objXML.async = False
>Then I can see number of attributes with this command for example (FIRST
>But if I send the object to a function doing this…:
>… where aTree is a function like this (SECOND ACCESS):
> if pNode.attributes.length>0 then
> end if
> end function
>==> Then I get a server ASP-processing error saying: Object required:
>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 van Ingen
>The day that Microsoft makes something that doesn't suck is probably the
>they start making vacuum cleaners.
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp