|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.xml.XMLUtils
public final class XMLUtils
XML Utility methods.
| Method Summary | |
|---|---|
static java.lang.String |
escape(java.lang.Object content)
Escapes all the XML special characters in a String using numerical XML entities. |
static java.lang.String |
escapeAttributeValue(java.lang.Object content)
Escapes all the XML special characters in a String using numerical XML entities, so that the
resulting string can safely be used as an XML attribute value. |
static java.lang.String |
escapeElementContent(java.lang.Object content)
Escapes the XML special characters in a String using numerical XML entities, so that the resulting
string can safely be used as an XML text node. |
static java.lang.String |
escapeXMLComment(java.lang.String content)
XML comment does not support some characters inside its content but there is no official escaping/unescaping for it so we made our own. |
static java.lang.String |
extractXML(org.w3c.dom.Node node,
int start,
int length)
Extracts a well-formed XML fragment from the given DOM tree. |
static java.lang.String |
unescape(java.lang.Object content)
Unescape encoded special XML characters. |
static java.lang.String |
unescapeXMLComment(java.lang.String content)
XML comment does not support some characters inside its content but there is no official escaping/unescaping for it so we made our own. |
| 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 extractXML(org.w3c.dom.Node node,
int start,
int length)
node - the root of the DOM tree where the extraction takes placestart - the index of the first characterlength - the maximum number of characters in text nodes to include in the returned fragment
public static java.lang.String escapeXMLComment(java.lang.String content)
content - the XML comment content to escape
public static java.lang.String unescapeXMLComment(java.lang.String content)
content - the XML comment content to unescape
escapeXMLComment(String)public static java.lang.String escape(java.lang.Object content)
String using numerical XML entities. Specifically,
escapes <, >, ", ' and &.
content - the text to escape, may be null
String, null if null inputpublic static java.lang.String escapeAttributeValue(java.lang.Object content)
String using numerical XML entities, so that the
resulting string can safely be used as an XML attribute value. Specifically, escapes <, >, ", ' and &.
content - the text to escape, may be null
String, null if null inputpublic static java.lang.String escapeElementContent(java.lang.Object content)
String using numerical XML entities, so that the resulting
string can safely be used as an XML text node. Specifically, escapes <, >, and &.
content - the text to escape, may be null
String, null if null inputpublic static java.lang.String unescape(java.lang.Object content)
content - the text to decode, may be null
null if null input
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||