public class XMLWikiPrinter extends Object
Modifier and Type | Field and Description |
---|---|
protected org.xwiki.rendering.internal.renderer.printer.WikiWriter |
wikiWriter |
protected org.dom4j.io.XMLWriter |
xmlWriter |
Constructor and Description |
---|
XMLWikiPrinter(WikiPrinter printer) |
Modifier and Type | Method and Description |
---|---|
org.dom4j.io.XMLWriter |
getXMLWriter() |
void |
printEntity(String entity) |
void |
printRaw(String row)
Print some text without escaping anything, it's supposed to be XML or at least contains only valid characters in
XML text node.
|
void |
printXML(String str)
Print provided text.
|
void |
printXMLComment(String content)
Print a XML comment.
|
void |
printXMLComment(String content,
boolean escape)
Print a XML comment.
|
void |
printXMLElement(String name)
Print the xml element.
|
void |
printXMLElement(String name,
Map<String,String> attributes)
Print the xml element.
|
void |
printXMLElement(String name,
String[][] attributes)
Print the xml element.
|
void |
printXMLEndCData()
End a CDATA section.
|
void |
printXMLEndElement(String name)
Print the end tag of xml element.
|
void |
printXMLStartCData()
Start a CDATA section.
|
void |
printXMLStartElement(String name)
Print the start tag of xml element.
|
void |
printXMLStartElement(String name,
Attributes attributes)
Print the start tag of xml element.
|
void |
printXMLStartElement(String name,
Map<String,String> attributes)
Print the start tag of xml element.
|
void |
printXMLStartElement(String name,
String[][] attributes)
Print the start tag of xml element.
|
void |
setWikiPrinter(WikiPrinter printer) |
protected org.xwiki.rendering.internal.renderer.printer.WikiWriter wikiWriter
protected org.dom4j.io.XMLWriter xmlWriter
public XMLWikiPrinter(WikiPrinter printer)
printer
- the object to which to write the XHTML output topublic org.dom4j.io.XMLWriter getXMLWriter()
public void setWikiPrinter(WikiPrinter printer)
public void printXML(String str)
str
- the string to printpublic void printXMLElement(String name)
<name/>
.name
- the xml element to printpublic void printXMLElement(String name, String[][] attributes)
<name att1="value1" att2="value2"/>
.name
- the xml element to printattributes
- the xml attributes of the element to printpublic void printXMLElement(String name, Map<String,String> attributes)
<name att1="value1" att2="value2"/>
.name
- the xml element to printattributes
- the xml attributes of the element to printpublic void printXMLStartElement(String name)
<name>
.name
- the xml element to printpublic void printXMLStartElement(String name, String[][] attributes)
<name att1="value1" att2="value2">
.name
- the xml element to printattributes
- the xml attributes of the element to printpublic void printXMLStartElement(String name, Map<String,String> attributes)
<name att1="value1" att2="value2">
.name
- the xml element to printattributes
- the xml attributes of the element to printpublic void printXMLStartElement(String name, Attributes attributes)
<name att1="value1" att2="value2">
.name
- the xml element to printattributes
- the xml attributes of the element to printpublic void printXMLEndElement(String name)
</name>
.name
- the xml element to printpublic void printXMLComment(String content)
--
characters (or -
if it's the last character). If you're not sure what the comment content will be
use printXMLComment(String, boolean)
instead, passing true for the second parameter.content
- the comment contentpublic void printXMLComment(String content, boolean escape)
content
- the comment contentescape
- indicate if comment content has to be escaped. XML content does not support -- and - (when it's the
last character). Escaping is based on backslash. "- --\ -" give "- \-\-\\ \-\ ".public void printXMLStartCData()
public void printXMLEndCData()
public void printEntity(String entity)
public void printRaw(String row)
row
- the contentCopyright © 2004–2021 XWiki. All rights reserved.