METHOD:  Object::selectSingleNode

This method is a Microsoft extension to the W3C DOM.

Object  Attr   CDATASection   CharacterData   Comment   Document   DocumentFragment   DocumentType   Entity   EntityReference   Node   Notation   ProcessingInstruction   Text

The selectSingleNode method returns a Node object for the first descendant node to match the specified pattern. The one parameter of this method is an XSL pattern query. If no match is made, it returns null. This method is similar to the selectNodes method, but returns only the first node to match the pattern rather than all of them.

The following example loads the 'vocabulary.xml' file and uses the selectSingleNode method get the first 'Spanish' element node. The code then displays its text.

   <Word type="noun" level="1">
   <Word type="verb" level="1">
   <Word type="adj" level="1">

Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False

Set Node = objXMLDoc.documentElement.selectSingleNode("Word/Spanish")


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information