|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.xml.XmlParser
public class XmlParser
XML Parser wrapper. This class wraps any standard JAXP1.1 parser with convieniant error and entity handlers and a mini dom-like document tree.
By default, the parser is created as a validating parser only if xercers is present. This can be configured by setting the "org.mortbay.xml.XmlParser.Validating" system property.
Nested Class Summary | |
---|---|
static class |
XmlParser.Attribute
XML Attribute. |
private class |
XmlParser.Handler
|
static class |
XmlParser.Node
XML Node. |
private class |
XmlParser.NoopHandler
|
Field Summary | |
---|---|
private Map |
_observerMap
|
private Stack |
_observers
|
private SAXParser |
_parser
|
private Map |
_redirectMap
|
private String |
_xpath
|
private Object |
_xpaths
|
Constructor Summary | |
---|---|
XmlParser()
Construct |
|
XmlParser(boolean validating)
Constructor. |
Method Summary | |
---|---|
void |
addContentHandler(String trigger,
ContentHandler observer)
Add a ContentHandler. |
String |
getXpath()
|
XmlParser.Node |
parse(File file)
Parse File. |
XmlParser.Node |
parse(InputSource source)
|
XmlParser.Node |
parse(InputStream in)
Parse InputStream. |
XmlParser.Node |
parse(String url)
Parse String URL. |
void |
redirectEntity(String name,
URL entity)
|
void |
setXpath(String xpath)
Set an XPath A very simple subset of xpath is supported to select a partial tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Map _redirectMap
private SAXParser _parser
private Map _observerMap
private Stack _observers
private String _xpath
private Object _xpaths
Constructor Detail |
---|
public XmlParser()
public XmlParser(boolean validating)
Method Detail |
---|
public void redirectEntity(String name, URL entity)
name
- entity
- public String getXpath()
public void setXpath(String xpath)
xpath
- The xpath to set.public void addContentHandler(String trigger, ContentHandler observer)
trigger
- Tag local or q name.observer
- SAX ContentHandlerpublic XmlParser.Node parse(InputSource source) throws IOException, SAXException
IOException
SAXException
public XmlParser.Node parse(String url) throws IOException, SAXException
IOException
SAXException
public XmlParser.Node parse(File file) throws IOException, SAXException
IOException
SAXException
public XmlParser.Node parse(InputStream in) throws IOException, SAXException
IOException
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |