Class DtdDemo

java.lang.Object
  extended by XmlApp
      extended by DtdDemo
All Implemented Interfaces:
XmlHandler

public class DtdDemo
extends XmlApp

Demonstration application showing DTD queries.

Usage: java DtdDemo <url>

Or, use it as an applet, supplying the URL as the url parameter.

Note: This does not preserve any processing instructions or parameter entities in the DTD; otherwise, produces a fully expanded and normalised version.

See Also:
XmlParser, XmlHandler, XmlApp

Field Summary
 
Fields inherited from class XmlApp
isApplet, parser
 
Constructor Summary
DtdDemo()
           
 
Method Summary
 void doctypeDecl(java.lang.String name, java.lang.String pubid, java.lang.String sysid)
          Dump the DTD.
 void dumpElements()
          Produce normalised declarations for all elements.
 void dumpEntities()
          Produce normalised declarations for all general entities.
 void dumpNotations()
          Produce normalised declarations for all notations.
 void endDocument(int errorCount)
          Print a comment showing where the DTD (if any) ends.
static void main(java.lang.String[] args)
          Entry point for an application (applets enter through XmlApp.init()).
 void startDocument()
          Print a comment showing where the DTD (if any) begins.
 
Methods inherited from class XmlApp
attribute, charData, endDocument, endElement, endExternalEntity, error, ignorableWhitespace, processingInstruction, resolveEntity, startElement, startExternalEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DtdDemo

public DtdDemo()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Entry point for an application (applets enter through XmlApp.init()).

Throws:
java.lang.Exception
See Also:
XmlApp.init

startDocument

public void startDocument()
Print a comment showing where the DTD (if any) begins.

Specified by:
startDocument in interface XmlHandler
Overrides:
startDocument in class XmlApp
See Also:
com.Microstar.xml.XmlHandler#startDocument

endDocument

public void endDocument(int errorCount)
Print a comment showing where the DTD (if any) ends.


doctypeDecl

public void doctypeDecl(java.lang.String name,
                        java.lang.String pubid,
                        java.lang.String sysid)
Dump the DTD.

Once this event is received, we know that the DTD is completely parsed, and can use AElfred's query routines to reconstruct a normalised version of it.

Specified by:
doctypeDecl in interface XmlHandler
Overrides:
doctypeDecl in class XmlApp
Parameters:
name - The document type name.
pubid - The public identifier, or null if unspecified.
sysid - The system identifier, or null if unspecified.
See Also:
dumpNotations(), dumpEntities(), dumpElements()

dumpNotations

public void dumpNotations()
Produce normalised declarations for all notations.

See Also:
makeExternalIdentifiers(java.lang.String, java.lang.String)

dumpEntities

public void dumpEntities()
Produce normalised declarations for all general entities.

See Also:
makeLiteral(java.lang.String), makeExternalIdentifiers(java.lang.String, java.lang.String)

dumpElements

public void dumpElements()
Produce normalised declarations for all elements.

See Also:
dumpAttributes(java.lang.String)