org.xwiki.xml.html
Class HTMLUtils.XWikiXMLOutputter

java.lang.Object
  extended by org.jdom.output.XMLOutputter
      extended by org.xwiki.xml.html.HTMLUtils.XWikiXMLOutputter
All Implemented Interfaces:
Cloneable
Enclosing class:
HTMLUtils

public static class HTMLUtils.XWikiXMLOutputter
extends org.jdom.output.XMLOutputter

JDOM's XMLOutputter class converts reserved XML characters (<, >, ' , &, \r and \n) into their entity format (<, > ' & and \r\n). However since we're using HTML Cleaner (http://htmlcleaner.sourceforge.net/) and since it's buggy for character escapes we have turned off character escaping for it and thus we need to perform selective escaping here.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jdom.output.XMLOutputter
org.jdom.output.XMLOutputter.NamespaceStack
 
Field Summary
 
Fields inherited from class org.jdom.output.XMLOutputter
currentFormat, preserveFormat
 
Constructor Summary
HTMLUtils.XWikiXMLOutputter(org.jdom.output.Format format, boolean omitDocType)
           
 
Method Summary
 String escapeAttributeEntities(String text)
          
 String escapeElementEntities(String text)
          
protected  void printDocType(Writer out, org.jdom.DocType docType)
          
 
Methods inherited from class org.jdom.output.XMLOutputter
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, printElement, printEntityRef, printProcessingInstruction, printText, setFormat, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLUtils.XWikiXMLOutputter

public HTMLUtils.XWikiXMLOutputter(org.jdom.output.Format format,
                                   boolean omitDocType)
Parameters:
format - the JDOM class used to control output formats, see Format
omitDocType - if true then omit the document type when printing the W3C Document
See Also:
XMLOutputter.XMLOutputter(Format)
Method Detail

escapeElementEntities

public String escapeElementEntities(String text)

Overrides:
escapeElementEntities in class org.jdom.output.XMLOutputter
See Also:
XMLOutputter.escapeElementEntities(String)

escapeAttributeEntities

public String escapeAttributeEntities(String text)

Overrides:
escapeAttributeEntities in class org.jdom.output.XMLOutputter
See Also:
XMLOutputter.escapeAttributeEntities(String)

printDocType

protected void printDocType(Writer out,
                            org.jdom.DocType docType)
                     throws IOException

Overrides:
printDocType in class org.jdom.output.XMLOutputter
Throws:
IOException
See Also:
XMLOutputter.printDocType(java.io.Writer, org.jdom.DocType)


Copyright © 2004-2011 XWiki. All Rights Reserved.