|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.run.xml.SaxParser
public class SaxParser
A simple XML parser. The public interface consists of nearly identical methods: parseXml(...) which produce a tree of SimpleElement objects
Nested Class Summary | |
---|---|
protected class |
SaxParser.ValidationHandler An inner class Error Handler that is registered in parser that performs validation. |
Constructor Summary | |
---|---|
SaxParser() Construct a SaxParser. |
|
SaxParser(boolean fAllowComments) Construct a SaxParser. |
Method Summary | |
---|---|
protected static org.xml.sax.Parser |
getParser() Get an instance of non-validating SAX parser. |
protected XmlElement |
instantiateRoot(java.lang.String sRoot) Instantiate an XmlElement implementation for a root element. |
static void |
main(java.lang.String[] asParam) Unit test: create a simple parser, parse and output the result. |
XmlElement |
parseXml(org.xml.sax.InputSource input) Parse the specified InputSource into a tree of XmlElement objects ignoring any XML nodes other then elements, text or comments (in a case of SaxParser that allows comments). |
protected XmlElement |
parseXml(org.xml.sax.InputSource input, XmlElement xmlRoot) |
XmlElement |
parseXml(java.io.InputStream input) Parse the specified InputStream into a tree of XmlElement objects ignoring any XML nodes other then elements, text or comments (in a case of SaxParser that allows comments). |
XmlElement |
parseXml(java.io.Reader input) Parse the specified Reader into a tree of XmlElement objects ignoring any XML nodes other then elements, text or comments (in a case of SaxParser that allows comments). |
XmlElement |
parseXml(java.lang.String sXml) Parse the specified String into a tree of XmlElement objects ignoring any XML nodes other then elements, text or comments (in a case of SaxParser that allows comments). |
XmlElement |
parseXml(java.lang.String sXml, XmlElement elRoot) Parse the specified String into a tree of XmlElement objects (same as above) having the specified [empty] XmlElement a root. |
protected javax.xml.transform.Source[] |
resolveSchemaSources(java.util.List listUri) For a given set of XSD URIs, return the Source s to be used by the XML parser to validate an XML document. |
void |
validateXsd(java.lang.String sXml, XmlDocument xml) XSD aware parsing routine; if XML contains an XSD reference to a schemeLocation/noNamespaceSchemaLocation then parse XML using provided XSD for validation. |
Constructor Detail |
---|
public SaxParser()
public SaxParser(boolean fAllowComments)
fAllowComments
- if true, the resulting tree may contain the XMLValue nodes that contain comments; otherwize all comments are ignoredMethod Detail |
---|
public static void main(java.lang.String[] asParam)
public XmlElement parseXml(java.lang.String sXml) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public XmlElement parseXml(java.lang.String sXml, XmlElement elRoot) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public XmlElement parseXml(java.io.InputStream input) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public XmlElement parseXml(java.io.Reader input) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public XmlElement parseXml(org.xml.sax.InputSource input) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected XmlElement parseXml(org.xml.sax.InputSource input, XmlElement xmlRoot) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void validateXsd(java.lang.String sXml, XmlDocument xml) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
sXml
- the XML to parse (as a string)xml
- the XML document object used to obtain schema locationsorg.xml.sax.SAXException
- if XML contains an XSD reference and does not pass validationjava.io.IOException
- if XML contains a schema that cannot be loadedjavax.xml.parsers.ParserConfigurationException
- if a parser cannot be createdprotected javax.xml.transform.Source[] resolveSchemaSources(java.util.List listUri) throws java.io.IOException
Source
s to be used by the XML parser to validate an XML document.listUri
- list of XSD URIs to convertSource
s to be used by the XML parserjava.io.IOException
- if the resource cannot be located or loadedprotected XmlElement instantiateRoot(java.lang.String sRoot)
sRoot
- root nameprotected static org.xml.sax.Parser getParser() throws java.lang.Exception
java.lang.Exception
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |