java.lang.Object
org.eclipse.ant.internal.ui.dtd.Parser
- public class Parser
- extends java.lang.Object
Simple parser for DTDs. Returns ISchema representing the DTD.
To parse a DTD, you must parse an XML document. The parseDTD()
method builds a temporary XML document in memory that refers to or includes
the DTD.
There is no dependency in this package on any code outside the package except
XMLReader.
To hide the underlying parser, XML parser exceptions are wrapped by a
ParseError. Unless debugging, the two string constants are sufficient to
determine the cause of the error.
|
Method Summary |
private org.xml.sax.XMLReader |
getXMLReader()
|
ISchema |
parse(org.xml.sax.InputSource inputSource,
org.xml.sax.EntityResolver entityResolver)
Parse the XML document at the input source and return a document walker
that can be used to validate any document with the same DTD (internal and
external) or provide user assistance for this document. |
ISchema |
parse(java.io.Reader reader)
Parse the XML document using the argument reader and return a document
walker that can be used to validate any document with the same DTD
(internal and external) or provide user assistance for this document. |
ISchema |
parse(java.lang.String url)
Parse the XML document at the argument URL and return a document walker
that can be used to validate any document with the same DTD (internal
and external) or provide user assistance for this document. |
ISchema |
parseDTD(java.io.Reader reader,
java.lang.String root)
Parse the DTD from the reader and return a document walker that can be
used to validate or provide user assistance for any document with the
same external DTD and no internal subset. |
ISchema |
parseDTD(java.lang.String pub,
java.lang.String sys,
java.lang.String root)
Parse the DTD with the given public and system ids and return a document
walker that can be used to validate or provide user assistance for any
document with the same external DTD and no internal subset. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NOT_SUPPORTED
public static final java.lang.String NOT_SUPPORTED
- ParseError message when system parser doesn't do the job
PARSE_ERROR
public static final java.lang.String PARSE_ERROR
- ParseError message for a well-formed or validation error in XML or DTD.
Currently not returned.
INTERNAL
private static final java.lang.String INTERNAL
- See Also:
- Constant Field Values
Parser
public Parser()
parse
public ISchema parse(org.xml.sax.InputSource inputSource,
org.xml.sax.EntityResolver entityResolver)
throws ParseError,
java.io.IOException
- Parse the XML document at the input source and return a document walker
that can be used to validate any document with the same DTD (internal and
external) or provide user assistance for this document.
getXMLReader
private org.xml.sax.XMLReader getXMLReader()
throws ParseError
parse
public ISchema parse(java.lang.String url)
throws ParseError,
java.io.IOException
- Parse the XML document at the argument URL and return a document walker
that can be used to validate any document with the same DTD (internal
and external) or provide user assistance for this document.
parse
public ISchema parse(java.io.Reader reader)
throws ParseError,
java.io.IOException
- Parse the XML document using the argument reader and return a document
walker that can be used to validate any document with the same DTD
(internal and external) or provide user assistance for this document.
parseDTD
public ISchema parseDTD(java.lang.String pub,
java.lang.String sys,
java.lang.String root)
throws ParseError,
java.io.IOException
- Parse the DTD with the given public and system ids and return a document
walker that can be used to validate or provide user assistance for any
document with the same external DTD and no internal subset.
parseDTD
public ISchema parseDTD(java.io.Reader reader,
java.lang.String root)
throws ParseError,
java.io.IOException
- Parse the DTD from the reader and return a document walker that can be
used to validate or provide user assistance for any document with the
same external DTD and no internal subset.