|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.inria.ns.reflex.xml.dom.DOMAdaptableParser
public class DOMAdaptableParser
A DOMAdaptableParser parses an XML source that may be an entire XML document (with or without DTD stuff) as well as an XML fragment (with several root elements and/or eventually text around the root element(s) ).
SAXAdaptableParser
Constructor Summary | |
---|---|
DOMAdaptableParser()
Create a parser that parses XML fragments as well as entire XML documents with a namespace-aware parser. |
|
DOMAdaptableParser(EntityResolver resolver,
ErrorHandler errorHandler)
Create a parser that parses XML fragments as well as entire XML documents with a namespace-aware parser. |
|
DOMAdaptableParser(ParserConfiguration configuration)
Create a parser that parses XML fragments as well as entire XML documents. |
|
DOMAdaptableParser(ParserConfiguration configuration,
EntityResolver resolver,
ErrorHandler errorHandler)
Create a parser that parses XML fragments as well as entire XML documents. |
Method Summary | |
---|---|
static Document |
adaptToDocument(Node node)
Transform a node to a document. |
static boolean |
canBeDocument(Node node)
Test if a Node can be a Document : it may contain 1 Element, not more ; it may contain 1 DocumentType, not more ; it can't have attributes ; if any, its Text nodes must be blanks (but they can't be part of the document child nodes) ; container nodes are flatenned (entity reference, document fragment). |
Node |
parse(InputSource input)
Parse an input source. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMAdaptableParser()
ParserConfiguration.NAMESPACEAWARE_PARSER_CONFIGURATION
public DOMAdaptableParser(ParserConfiguration configuration)
configuration
- The non-null
configuration
expected for the parser.public DOMAdaptableParser(ParserConfiguration configuration, EntityResolver resolver, ErrorHandler errorHandler)
configuration
- The non-null
configuration
expected for the parser.resolver
- The resolver to use while parsing.errorHandler
- The error handler to use while parsing.public DOMAdaptableParser(EntityResolver resolver, ErrorHandler errorHandler)
resolver
- The resolver to use while parsing.errorHandler
- The error handler to use while parsing.ParserConfiguration.NAMESPACEAWARE_PARSER_CONFIGURATION
Method Detail |
---|
public Node parse(InputSource input) throws SAXException, IOException, ParserConfigurationException
input
- The input to parse.
ParserConfigurationException
- Change your parser if you see this error.
SAXException
IOException
DocumentFragment
,
Document
public static Document adaptToDocument(Node node) throws ParserConfigurationException
canBeDocument(Node)
before.
The result document is the same as the
owner document of the candidate node if
the candidate node is a fragment and its
host document has no child node.
node
- The node that can be a document.
ParserConfigurationException
- Change your parser if you have such an error.canBeDocument(Node)
public static boolean canBeDocument(Node node)
node
- The node to test.
true
if the node is a good candidate,
false
otherwise.adaptToDocument(Node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |