|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ccl.xml.XMLUtil
This class provides generic helper methods to deal with xml or xslt processing.
Credit: code to escape a string so it can be used as xml text content or an attribute value is taken from the Apache Xerces project.
Method Summary | |
static java.lang.String |
escape(char ch)
If there is a suitable entity reference for this character, return it. |
static java.lang.String |
escape(java.lang.String source)
Escapes a string so it may be returned as text content or attribute value. |
static java.lang.String |
getValueOf(java.io.File xmlFile,
java.lang.String xpath)
Return the xml value in the given xml file described by the XPath value. |
static java.lang.String |
getValueOf(java.lang.String xmlContent,
java.lang.String xpath)
Return the xml value in the given xml string described by the XPath value. |
static java.lang.String |
getXML(java.io.File xmlFile,
java.io.File xsltFile)
Transforms a given xml content with a given xslt stylesheet file. |
static java.lang.String |
getXML(java.io.File xmlFile,
java.lang.String xsltFile)
Transforms a given xml content with a given xslt stylesheet file. |
static java.lang.String |
getXML(java.lang.String xmlContent,
java.io.File xsltFile)
Transforms a given xml content with a given xslt stylesheet file. |
static java.lang.String |
getXML(java.lang.String xmlContent,
java.lang.String xsltContent)
Transforms a given xml content using the given xslt stylesheet content. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.String escape(char ch)
public static java.lang.String escape(java.lang.String source)
source
- the string to escape or "" for null.public static java.lang.String getXML(java.io.File xmlFile, java.lang.String xsltFile) throws java.io.IOException, javax.xml.transform.TransformerException
java.io.IOException
- if the xml file can't be red.
javax.xml.transform.TransformerException
- if parsing the xml or xslt data fails.public static java.lang.String getXML(java.io.File xmlFile, java.io.File xsltFile) throws java.io.IOException, javax.xml.transform.TransformerException
java.io.IOException
- if the xml or xslt file can't be red.
javax.xml.transform.TransformerException
- if parsing the xml or xslt data fails.public static java.lang.String getXML(java.lang.String xmlContent, java.io.File xsltFile) throws java.io.IOException, javax.xml.transform.TransformerException
java.io.IOException
- if the xslt file can't be red.
javax.xml.transform.TransformerException
- if parsing the xml or xslt data fails.public static java.lang.String getXML(java.lang.String xmlContent, java.lang.String xsltContent) throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
- if parsing the xml or xslt data fails.public static java.lang.String getValueOf(java.lang.String xmlContent, java.lang.String xpath) throws java.lang.Exception
xmlContent
- a string with xml data.xpath
- an XPath string describing the
location of an xml element.
java.lang.Exception
- if any parsing error happens.public static java.lang.String getValueOf(java.io.File xmlFile, java.lang.String xpath) throws java.lang.Exception
xmlFile
- a file with xml data.xpath
- an XPath string describing the
location of an xml element.
java.lang.Exception
- if any parsing error happens.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |