PROPERTY:  Object::baseName

This property is a Microsoft extension to the W3C DOM.

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

The baseName property is a read-only property that returns the base name for a node. Where this is a namespace qualified name, only the right-hand part of it is returned, i.e. for an element such as <dg:title> it would return 'title'. This property always returns a non-empty string. In the following example a file called 'CDs.xml' is loaded whose root node is a tag <CDs>. The root element of an XML document is referred to by the documentElement property, and the code uses this along with the baseName property to get its base name and store it in a variable before writing it to the page.

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

Dim strBaseName
strBaseName = objXMLDoc.documentElement.baseName
document.write(strBaseName)

Output:
CDs



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