|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.ajaxtags.helpers.XMLUtils
public final class XMLUtils
Some helper functions for XML.
Method Summary | |
---|---|
static Document |
createDocument()
Create a new Document . |
static NodeList |
evaluateXPathExpression(String expression,
Node node)
Evaluate XPath expression and return list of nodes. |
static Object |
evaluateXPathExpression(String expression,
Node node,
QName returnValue)
Evaluate XPath expression. |
static String |
format(String xml)
Parse string as XML document and return string with reformatted document. |
static XPath |
getNewXPath()
Create and return a new XPath object from ThreadLocal . |
static Document |
getXMLDocument(String xml)
Parse string with XML content to Document . |
static String |
toString(Document document)
Transform document to string representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static NodeList evaluateXPathExpression(String expression, Node node) throws XPathExpressionException
expression
- XPath expressionnode
- DOM node
XPathExpressionException
- if expression cannot be evaluatedpublic static Object evaluateXPathExpression(String expression, Node node, QName returnValue) throws XPathExpressionException
expression
- XPath expressionnode
- DOM nodereturnValue
- the desired return type
XPathExpressionException
- if expression cannot be evaluatedpublic static XPath getNewXPath()
XPath
object from ThreadLocal
.
XPath
object.public static Document getXMLDocument(String xml) throws SAXException
Document
.
xml
- string with XML content
SAXException
- if any parse errors occurpublic static Document createDocument() throws ParserConfigurationException
Document
.
ParserConfigurationException
- if a DocumentBuilder cannot be createdpublic static String format(String xml) throws TransformerException, SAXException
xml
- string with XML content
TransformerException
- if it is not possible to transform document to string
SAXException
- if any parse errors occurpublic static String toString(Document document) throws TransformerException
document
- XHTML document
TransformerException
- if it is not possible to create a Transformer instance or to
transform document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |