public static class HTMLUtils.XWikiXMLOutputter
extends org.jdom.output.XMLOutputter
&
) into its entity
format &
. However since we're using HTML Cleaner
(http://htmlcleaner.sourceforge.net/) and since it's buggy for unicode character escapes we have turned off
character escaping for it and thus we need to perform selective escaping here.
Moreover, since we support HTML5, we need to
expand empty elements on some elements and not on the others. For example: <span></span>
is valid
meanwhile:
<br>
</br>
is not. See OMIT_ELEMENT_EXPANDING_SET
for the list of elements to not expand.Constructor and Description |
---|
XWikiXMLOutputter(org.jdom.output.Format format,
boolean omitDocType) |
Modifier and Type | Method and Description |
---|---|
String |
escapeAttributeEntities(String text) |
String |
escapeElementEntities(String text) |
protected void |
printDocType(Writer out,
org.jdom.DocType docType) |
protected void |
printElement(Writer out,
org.jdom.Element element,
int level,
org.jdom.output.XMLOutputter.NamespaceStack namespaces) |
clone, getFormat, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, output, outputElementContent, outputElementContent, outputString, outputString, outputString, outputString, outputString, outputString, outputString, outputString, outputString, printAttributes, printCDATA, printComment, printDeclaration, printEntityRef, printProcessingInstruction, printText, setFormat, toString
public XWikiXMLOutputter(org.jdom.output.Format format, boolean omitDocType)
format
- the JDOM class used to control output formats, see Format
omitDocType
- if true then omit the document type when printing the W3C DocumentXMLOutputter(Format)
public String escapeElementEntities(String text)
escapeElementEntities
in class org.jdom.output.XMLOutputter
public String escapeAttributeEntities(String text)
escapeAttributeEntities
in class org.jdom.output.XMLOutputter
protected void printDocType(Writer out, org.jdom.DocType docType) throws IOException
printDocType
in class org.jdom.output.XMLOutputter
IOException
protected void printElement(Writer out, org.jdom.Element element, int level, org.jdom.output.XMLOutputter.NamespaceStack namespaces) throws IOException
printElement
in class org.jdom.output.XMLOutputter
IOException
Copyright © 2004–2021 XWiki. All rights reserved.