notations (W3C DOM Core property)

Spec
Version Depr. Static Read-only
DOM1 No No Yes
Browser support (more…)
IE5.5+ FF3 SA3 OP9+
Partial None None Partial

Example

var notations = document.doctype.notations;

The example above saves a reference to the notations collection, which itself is a property of the doctype. Each member of the collection is a Notation node, and can be retrieved using the getNamedItem method:

notations.getNamedItem('sitepoint')

Description

The notations collection is an unordered list of every Notation declared in the DTD. Notations are used for declaring the format of an unparsed entity, or the target of a processing instruction.

This collection is a NamedNodeMap, primarily intended to be accessed by name. It's also possible to access the items by their index in the map, however the DOM does not specify what order they will appear.

As with all named node maps, notations[] is a live collection, which means that changes to the collection it represents are immediately reflected in the node map (as opposed to it being a static snapshot).

Each member of this collection is a Notation node, and is readonly.

Note: A collection is not an array

Even though a collection looks like an array, it isn't an array — although you can iterate through it and refer to its members like an array, you can't use Array methods like push or pop on it.

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
Note: Very sparsely supported

This collection is very sparsely supported, but there's no other way to retrieve this data. Just gotta hope you never need to!

Only Opera in XHTML mode or XML1 and Internet Explorer in XML provide data for the notations collection; in Firefox, Safari 3 and Safari 1.3 and 2 in XHTML mode or XML 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 the 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')).

Footnotes

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

User-contributed notes

There are no comments yet.

Related Products