Notation (W3C DOM Core object)

Spec
Version Depr. Parent
DOM1 No Node
Browser support (more…)
IE5.5+ FF3 SA3 OP9+
Partial None None Partial

Example

<!NOTATION logo SYSTEM "image/gif">

The example above shows a notation with the name logo, that refers to a system resource with the mime-type image/gif. This notation can then be used as part of an entity declaration, to refer to an external GIF image:

<!ENTITY sitepoint SYSTEM
    "http://www.sitepoint.com/images/new/logo.gif"
    NDATA logo>

We can get a reference to the notations declared in the DTD from the notations collection, which itself is a property of the doctype:

var notations = document.doctype.notations;

And then retrieve individual items from that collection using the getNamedItem method:

notations.getNamedItem('sitepoint')

Description

The Notation interface inherits from Node, and represents a notation declared in the DTD. Notations are typically used to declare the format of an unparsed entity; they can also be used for formal declaration of processing instruction targets. The content of an unparsed entity does not have to be text, it can be other kinds of data, such as an image.

Notation nodes are read-only, and are not part of the DOM tree, hence they have no parent and cannot have children.

Compatibility

Internet Explorer Firefox Safari Opera
5.5 6.0 7.0 1.5 2.0 3.0 1.3 2.0 3.0 9.0 9.5
Partial Partial Partial None None None None None None Partial Partial

Only Internet Explorer in XML and Opera in XHTML mode or XML1 provide data for the notations collection; in Firefox, Safari 1.3 and 2 in XHTML mode or XML and Safari 3 the collection is null; in other environments the doctype itself is null or undefined (see DocumentType for details).

Internet Explorer in XML doesn't support associative array syntax for retrieving members by name (eg. notations['sitepoint']); it only supports reference by index (eg. notations[0]) or using the getNamedItem method of NamedNodeMap (eg. notations.getNamedItem('sitepoint')).

In this Section

Footnotes

1 On XHTML pages served as application/xhtml+xml.

User-contributed notes

There are no comments yet.

Related Products