Chapter 3 DynaScript Predefined Objects


DOMImplementation object

Object

Provides a means of querying the capabilities of this application's implementation of DOM.

Syntax

To use a DOMImplementation's method:

DOMImplementation.MethodName( parameter ) 

Description

The DOMImplementation object has one method used to query the features supported by this specific implementation of DOM. This method is independent of any particular instance of a DOMDocument .

Dynamo's current implementation of DOM supports parsing of XML 1.0 documents according to DOM Level 1.

hasFeature method

Syntax

DOMImplementation.hasFeature( feature, version )

Description

Tests if the DOM implementation includes a specific feature. The parameters are:

Return

Boolean. True if the feature is implemented in the specified version, false otherwise.

Example

To write out the features supported by the Dynamo XML parser, enter:

domDoc = new DOMDocument();
implementation = domDoc.implementation;
document.writeln( "HTML? " + implementation.hasFeature( "HTML", "1.0" ) ) ;
document.writeln( "XML? " + implementation.hasFeature( "XML", "1.0" ) );

The output is:

HTML? false
XML? true

 


Copyright © 2001 Sybase, Inc. All rights reserved.