Name

notations: NamedNodeMap

Synopsis

A NamedNodeMap contains a list of XML notation declarations for the current document. Each member of this list implements the Notation interface, and the list itself is read-only.

Java binding

public NamedNodeMap getNotations( );

Java example

// Dump the document notations
NamedNodeMap nnm = doc.getDoctype( ).getNotations( );
Notation ndNotation;
for (int i = 0; i < nnm.getLength( ); i++) {
    ndNotation = (Notation)nnm.item(i);
     
    System.out.println(ndNotation.getNodeName( ));
    if (ndNotation.getPublicId( ) != null) {
        System.out.println("\tPublic Identifier: " +
                           ndNotation.getPublicId( ));
    }
    if (ndNotation.getSystemId( ) != null) {
        System.out.println("\tSystem Identifier: " +
                           ndNotation.getSystemId( ));
    }
}

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.