|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.plugins.markup.XHTML
public final class XHTML
Helper methods for working with XHTML.
Method Summary | |
---|---|
static java.lang.String |
cleanUpContent(java.lang.String content)
Clean up invalid characters and HTML tags. |
static char[] |
escape(char character)
Escape a html/xhtml character. |
static java.lang.String |
escape(java.lang.String string)
Escape a html/xhtml string. |
static java.lang.String |
evaluateXPath(java.io.InputStream page,
java.lang.String xpathExpression)
Apply an xPath expression to an xhtml page. |
static org.w3c.dom.NodeList |
evaluateXPathToNodeList(org.w3c.dom.Document doc,
java.lang.String xpathExpression)
Apply an xPath expression to an xhtml page. |
static boolean |
isValid(java.io.InputStream page)
Test whether an xhtml page is valid. |
static void |
printErrors(java.io.InputStream page,
java.io.PrintStream out)
Validate an xhtml page and print any errors to the specified PrintStream . |
static java.lang.String |
sanitize(java.lang.String raw)
Sanitize a html/xhtml string. |
static java.lang.String |
sanitizeUrl(java.lang.String raw)
Sanitize a string representation of a URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isValid(java.io.InputStream page)
page
- The page to be validated, as an input stream.
public static java.lang.String evaluateXPath(java.io.InputStream page, java.lang.String xpathExpression)
page
- The page to which we'll apply the expression.xpathExpression
- The expression to apply.
XPath.evaluate(String, Object)
for further details.public static org.w3c.dom.NodeList evaluateXPathToNodeList(org.w3c.dom.Document doc, java.lang.String xpathExpression)
doc
- The document to which we'll apply the expression.xpathExpression
- The expression to apply.
XPath.evaluate(String, Object)
for further details.public static void printErrors(java.io.InputStream page, java.io.PrintStream out)
PrintStream
.
page
- The page to validate.out
- The print stream to which errors will be written.public static java.lang.String escape(java.lang.String string)
This method converts all HTML 4.01 'markup significant' characters to their equivalent entities, as follows:
string
- The string to escape.
public static char[] escape(char character)
This method converts all HTML 4.01 'markup significant' characters to their equivalent entities, as follows:
character
- The character to escape.
public static java.lang.String cleanUpContent(java.lang.String content)
content
- The content to clean up.
public static java.lang.String sanitize(java.lang.String raw)
raw
- The un-sanitized string.
public static java.lang.String sanitizeUrl(java.lang.String raw)
This method only allows correctly form HTTP URLs.
raw
- The un-sanitized string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |