com.opensymphony.util
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Constructor Summary | |
|---|---|
XMLUtils()
|
|
| Method Summary | |
|---|---|
static Node |
cloneNode(Node node,
Document target,
boolean deep)
Clone given Node into target Document. |
static int |
getCacheSize()
Accessor for the internal XSL transformer cache |
static String |
getElementText(Element element)
Return the contained text within an Element. |
static Document |
newDocument()
Create blank Document. |
static Document |
newDocument(String rootElementName)
Create blank Document, and insert root element with given name. |
static Document |
parse(File file)
Parse a File of XML into Document. |
static Document |
parse(InputSource in)
Parse an InputSource of XML into Document. |
static Document |
parse(InputStream in)
Parse an InputStream of XML into Document. |
static Document |
parse(Reader in)
Parse a Reader of XML into Document. |
static Document |
parse(String xml)
Parse a String containing XML data into a Document. |
static Document |
parse(URL url)
Parse the contents of a URL's XML into Document. |
static String |
print(Document document)
Pretty-print a Document back to String of XML. |
static void |
print(Document document,
File file)
Pretty-print a Document to File. |
static void |
print(Document document,
OutputStream out)
Pretty-print a Document to OutputStream. |
static void |
print(Document document,
Writer out)
Pretty-print a Document to Writer. |
static void |
setCacheSize(int newCacheSize)
Sets the internal cache size for XSL sheets |
static Document |
transform(Document xml,
Document xsl)
Perform XSL transformations using given Documents and return new Document. |
static void |
transform(InputStream xml,
InputStream xsl,
OutputStream result)
Perform XSL transformation. |
static void |
transform(Reader xml,
Reader xsl,
Writer result)
Perform XSL transformation. |
static void |
transform(Reader xml,
Reader xsl,
Writer result,
Map parameters)
Perform XSL transformation, with params. |
static void |
transform(Reader xml,
Reader xsl,
Writer result,
Map parameters,
String xslkey)
This method applies an XSL sheet to an XML document. |
static String |
transform(String xml,
String xsl)
Perform XSL transformation. |
static Node |
xpath(Node base,
String xpath)
Return single Node from base Node using X-Path expression. |
static NodeList |
xpathList(Node base,
String xpath)
Return multiple Nodes from base Node using X-Path expression. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLUtils()
| Method Detail |
|---|
public static final String getElementText(Element element)
public static final Node cloneNode(Node node, Document target, boolean deep) throws DOMException
DOMExceptionpublic static final Document newDocument() throws ParserConfigurationException
ParserConfigurationExceptionpublic static final Document newDocument(String rootElementName) throws ParserConfigurationException
ParserConfigurationExceptionpublic static final Document parse(InputSource in) throws ParserConfigurationException, IOException, SAXException
public static final Document parse(InputStream in) throws ParserConfigurationException, IOException, SAXException
public static final Document parse(Reader in) throws ParserConfigurationException, IOException, SAXException
public static final Document parse(File file) throws ParserConfigurationException, IOException, SAXException
public static final Document parse(URL url) throws ParserConfigurationException, IOException, SAXException
public static final Document parse(String xml) throws ParserConfigurationException, IOException, SAXException
public static final void print(Document document, Writer out) throws IOException
IOExceptionpublic static final void print(Document document, OutputStream out) throws IOException
IOExceptionpublic static final void print(Document document, File file) throws IOException
IOExceptionpublic static final String print(Document document) throws IOException
IOExceptionpublic static final void transform(Reader xml, Reader xsl, Writer result) throws TransformerException
TransformerExceptionpublic static final Node xpath(Node base, String xpath) throws TransformerException
TransformerExceptionpublic static final NodeList xpathList(Node base, String xpath) throws TransformerException
TransformerExceptionpublic static void setCacheSize(int newCacheSize)
newCacheSize - public static int getCacheSize()
public static final void transform(Reader xml, Reader xsl, Writer result, Map parameters, String xslkey) throws TransformerException
2002/Apr/7, fixed bug 540875, first reported by Erik Weber, and added configurable cache size.
xml - the XML sourcexsl - the XSL sourceresult - where to put the responseparameters - a map consisting of params for the transformerxslkey - a key used to refer to the XSL
TransformerExceptionpublic static final void transform(Reader xml, Reader xsl, Writer result, Map parameters) throws TransformerException
TransformerExceptionpublic static final void transform(InputStream xml, InputStream xsl, OutputStream result) throws TransformerException
TransformerExceptionpublic static final String transform(String xml, String xsl) throws TransformerException
TransformerExceptionpublic static final Document transform(Document xml, Document xsl) throws ParserConfigurationException, TransformerException
|
OSCore Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||