[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Access the IXMLDOMNode's "attribute" property

  • From: Wayne Steele <xmlmaster@h...>
  • To: stephan.van.ingen@a..., xml-dev@l...
  • Date: Fri, 12 Oct 2001 12:46:57 -0700

ixmldomnode attributes
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 
sometimes.

-Wayne Steele



>From: "Stephan van Ingen, thuis" <stephan.van.ingen@a...>
>To: xml-dev@l...
>Subject:  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
>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@a...
>http://www.stephanvaningen.net
>
>--------------------------------------------------------------------------
>The day that Microsoft makes something that doesn't [expletive deleted] is probably the 
>day
>they start making vacuum cleaners.
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.