public class XmlParser
extends java.lang.Object
By default, the parser is created as a validating parser. This can be changed by setting the "org.mortbay.xml.XmlParser.NotValidating" system property to true.
Modifier and Type | Class and Description |
---|---|
static class |
XmlParser.Attribute
XML Attribute.
|
static class |
XmlParser.Node
XML Node.
|
Constructor and Description |
---|
XmlParser()
Construct
|
XmlParser(boolean validating)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getXpath() |
XmlParser.Node |
parse(java.io.File file)
Parse File.
|
XmlParser.Node |
parse(org.xml.sax.InputSource source) |
XmlParser.Node |
parse(java.io.InputStream in)
Parse InputStream.
|
XmlParser.Node |
parse(java.lang.String url)
Parse string URL.
|
XmlParser.Node |
parse(java.net.URL url)
Parse URL.
|
void |
redirectEntity(java.lang.String name,
java.net.URL entity) |
void |
setXpath(java.lang.String xpath)
Set an XPath
A very simple subset of xpath is supported to select a partial
tree.
|
public XmlParser()
public XmlParser(boolean validating)
public void redirectEntity(java.lang.String name, java.net.URL entity)
name
- entity
- public java.lang.String getXpath()
public void setXpath(java.lang.String xpath)
xpath
- The xpath to set.public XmlParser.Node parse(org.xml.sax.InputSource source) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public XmlParser.Node parse(java.lang.String url) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public XmlParser.Node parse(java.io.File file) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public XmlParser.Node parse(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public XmlParser.Node parse(java.net.URL url) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.