Help Center

Local Navigation

Object: DOMImplementation

Availability

BlackBerry® Device Software version 4.6 or later

The DOMImplementation object defines methods for performing operations that are independent of any particular instance of the DOM, such as creating new documents. You can check the object to determine if the DOMImplementation supports a given feature.

DOMImplementation methods

Method name

Description

Availability

createCSSStyleSheet()

Creates a new CSS stylesheet document object.

4.6 or later

createDocument()

Creates a new XML or HTML document object.

4.6 or later

createDocumentType()

Creates an empty document type node.

4.6 or later

hasFeature()

Determines whether the DOM implementation implements a specific feature.

4.6 or later

Method: DOMImplementation.createCSSStyleSheet()

Availability

BlackBerry® Device Software version 4.6 or later

The createCSSStyleSheet() method creates a new CSSStyleSheet object.

Syntax

DOMImplementation.createCSSStyleSheet( title, media )

Parameters

Parameter

Type

Description

title

String

The title of the CSS style sheet.

media

String

A comma-separated list of media types associated with the new style sheet.

Return values

Returns the new CSSStyleSheet object.

Exceptions

Exception

Description

SYNTAX_ERR

This error is thrown if media has a syntax error that prevents the browser from being able to parse it.

See also

CSSStyleSheet

Method: DOMImplementation.createDocument()

Availability

BlackBerry® Device Software version 4.6 or later

The createDocument() method creates a new XML or HTML Document object.

Syntax

DOMImplementation.createDocument( namespaceURI, qualifiedName, doctype )

Parameters

Parameter

Type

Description

namespaceURI

String

The namespace of the new document.

qualifiedName

String

The qualified name of the document to create.

doctype

DocumentType

The type of document to be created, or null.

Return values

Returns the new Document object.

Exceptions

Exception

Description

SYNTAX_ERR

This error is thrown if qualifiedName contains an illegal character.

NAMESPACE_ERR

This error is thrown if:

  • qualifiedName is malformed

  • qualifiedName has a prefix, but namespaceURI is null

  • prefix is xml, but namespaceURI is not http://www.w3.org/XML/1998/namespace

  • qualifiedName is xmlns, but namespaceURI is not http://www.w3.org/2000/xmlns/

NOT_SUPPORTED_ERR

This error is thrown if the document does not support XML namespaces.

WRONG_DOCUMENT_ERR

This error is thrown if doctype has already been used with a different document or was created from a different implementation.

See also

Document

Method: DOMImplementation.createDocumentType()

Availability

BlackBerry® Device Software version 4.6 or later

The createDocumentType() method creates an empty DocumentType node.

Syntax

DOMImplementation.createDocumentType( qualifiedName, publicId, systemId )

Parameters

Parameter

Type

Description

qualifiedName

String

The qualified name of the document.

publicId

String

The qualified name of the document to create.

systemId

String

The type of document to be created, or null.

Return values

Returns the new DocumentType object.

Exceptions

Exception

Description

INVALID_CHARACTER_ERR

This error is thrown if qualifiedName contains an illegal character.

NAMESPACE_ERR

This error is thrown if:

  • qualifiedName is malformed

  • qualifiedName has a prefix, but namespaceURI is null

  • prefix is xml, but namespaceURI is not http://www.w3.org/XML/1998/namespace

  • qualifiedName is xmlns, but namespaceURI is not http://www.w3.org/2000/xmlns/

See also

DocumentType

Method: DOMImplementation.hasFeature()

Availability

BlackBerry® Device Software version 4.6 or later

The hasFeature() method determines whether the DOM implementation implements a specific feature. This is equivalent to functionality provided using Node.isSupported().

Syntax

DOMImplementation.hasFeature( feature, version )

Parameters

Parameter

Type

Description

feature

String

The name of the feature to test.

version

String

The version of the feature to test. This parameter may be null.

If version is not specified, this method returns true if any version of the feature is supported.

Return values

Returns:

  • true, if the specified version of the specified feature is supported.
  • false, if the specified version of the specified feature is not supported.

Exceptions

None.

Next topic: Object: DOMParser
Previous topic: DocumentType properties

Was this information helpful? Send us your comments.