Example usage for org.w3c.dom DocumentType getNotations

List of usage examples for org.w3c.dom DocumentType getNotations

Introduction

In this page you can find the example usage for org.w3c.dom DocumentType getNotations.

Prototype

public NamedNodeMap getNotations();

Source Link

Document

A NamedNodeMap containing the notations declared in the DTD.

Usage

From source file:TreeDumper2.java

private void dumpDocumentType(DocumentType node, String indent) {
    System.out.println(indent + "DOCUMENT_TYPE: " + node.getName());
    if (node.getPublicId() != null)
        System.out.println(indent + " Public ID: " + node.getPublicId());
    if (node.getSystemId() != null)
        System.out.println(indent + " System ID: " + node.getSystemId());
    NamedNodeMap entities = node.getEntities();
    if (entities.getLength() > 0) {
        for (int i = 0; i < entities.getLength(); i++) {
            dumpLoop(entities.item(i), indent + "  ");
        }/*  w w w.  j a  v a 2  s. c o m*/
    }
    NamedNodeMap notations = node.getNotations();
    if (notations.getLength() > 0) {
        for (int i = 0; i < notations.getLength(); i++)
            dumpLoop(notations.item(i), indent + "  ");
    }
}

From source file:tufts.vue.ds.XMLIngest.java

public static Schema ingestXML(XmlSchema schema, org.xml.sax.InputSource input, String itemKey) {
    final org.w3c.dom.Document doc = parseXML(input, false);

    //doc.normalizeDocument();
    if (DEBUG.DR) {
        try {//from w  w  w.j  a  v a  2s  .com
            errout("XML parsed, document built:");
            errout("org.w3c.dom.Document: " + Util.tags(doc));
            final org.w3c.dom.DocumentType type = doc.getDoctype();
            //errout("InputEncoding: " + doc.getInputEncoding()); // AbstractMethodError ?
            //errout("xmlEncoding: " + doc.getXmlEncoding()); // AbstractMethodError
            //errout("xmlVersion: " + doc.getXmlVersion()); // AbstractMethodError
            errout("docType: " + Util.tags(type));
            if (type != null) {
                errout("docType.name: " + Util.tags(type.getName()));
                errout("docType.entities: " + Util.tags(type.getEntities()));
                errout("docType.notations: " + Util.tags(type.getNotations()));
                errout("docType.publicId: " + Util.tags(type.getPublicId()));
                errout("docType.systemId: " + Util.tags(type.getSystemId()));
            }
            errout("impl: " + Util.tags(doc.getImplementation().getClass()));
            errout("docElement: " + Util.tags(doc.getDocumentElement().getClass())); // toString() can dump whole document!
        } catch (Throwable t) {
            Log.error("debug failure", t);
        }
    }
    //out("element: " + Util.tags(doc.getDocumentElement()));

    //outln("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
    //outln("<!-- created by RSSTest " + new Date() + " from " + src + " -->");

    if (schema == null)
        schema = new XmlSchema(tufts.vue.Resource.instance(input), itemKey);
    else
        schema.flushData();

    if (false)
        XPathExtract(schema, doc);
    else
        scanNode(schema, doc.getDocumentElement(), null, null);

    if (DEBUG.DR || DEBUG.SCHEMA)
        schema.dumpSchema(System.err);
    return schema;
}