Class Xml

  extended by com.caucho.xml.AbstractParser
      extended by com.caucho.xml.XmlParser
          extended by com.caucho.xml.Xml
All Implemented Interfaces:
org.xml.sax.Parser, org.xml.sax.XMLReader

public class Xml
extends XmlParser

XML parser interface. The parser can parse directly into the DOM or it can be used as a SAX parser.

To parse a file into a DOM Document use

 Document doc = new Xml().parseDocument("foo.xml");

To parse a string into a DOM Document use

 String xml = "<top>small test</top>";
 Document doc = new Xml().parseDocumentString(xml);

To parse a file using the SAX API use

 Xml xml = new Xml();

Nested Class Summary
Nested classes/interfaces inherited from class com.caucho.xml.XmlParser
Field Summary
Fields inherited from class com.caucho.xml.XmlParser
Constructor Summary
          Create a new strict XML parser
Method Summary
static Xml create()
          Creates an Xml parser.
static CauchoDocument createDocument()
          Create a new DOM document
static org.w3c.dom.DOMImplementation createDOMImplementation()
          Create a new DOM implementation
 void free()
          Frees an Xml parser.
 void init()
          Initialize the parser.
Methods inherited from class com.caucho.xml.XmlParser
getColumnNumber, getFilename, getLine, getLineNumber, getPublicId, getSystemId, pushNamespace, setLine, setReader, unread
Methods inherited from class com.caucho.xml.AbstractParser
getContentHandler, getDefaultEncoding, getDTDHandler, getEncoding, getEntitiesAsText, getEntityResolver, getErrorHandler, getFeature, getForgiving, getJsp, getProperty, getResinInclude, getSearchPath, getSkipComments, isCoalescing, isDtdValidating, isNamespaceAware, isNamespacePrefixes, isSAXNamespaces, isValidating, openSource, openStream, openStream, openStream, openTopStream, parse, parse, parse, parse, parse, parseDocument, parseDocument, parseDocument, parseDocument, parseDocument, parseDocument, parseDocumentString, parseImpl, parseString, setAutodetectXml, setCoalescing, setConfig, setContentHandler, setDefaultEncoding, setDocumentHandler, setDTDHandler, setDtdValidating, setEntitiesAsText, setEntityResolver, setErrorHandler, setExpandEntities, setFeature, setFilename, setForgiving, setJsp, setLexicalHandler, setLocale, setNamespaceAware, setNamespacePrefixes, setOwner, setProperty, setResinInclude, setSAXNamespaces, setSearchPath, setSkipComments, setSkipWhitespace, setToLower, setValidating
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Xml()
Create a new strict XML parser

Method Detail


public void init()
Initialize the parser.


public static Xml create()
Creates an Xml parser.


public void free()
Frees an Xml parser.

free in class XmlParser


public static CauchoDocument createDocument()
Create a new DOM document


public static org.w3c.dom.DOMImplementation createDOMImplementation()
Create a new DOM implementation