org.htmlcleaner
Class DomSerializer
java.lang.Object
org.htmlcleaner.DomSerializer
public class DomSerializer
- extends Object
DOM serializer - creates xml DOM.
Field Summary |
protected boolean |
escapeXml
Whether XML entities should be escaped or not. |
protected CleanerProperties |
props
The HTML Cleaner properties set by the user to control the HTML cleaning. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
props
protected CleanerProperties props
- The HTML Cleaner properties set by the user to control the HTML cleaning.
escapeXml
protected boolean escapeXml
- Whether XML entities should be escaped or not.
DomSerializer
public DomSerializer(CleanerProperties props,
boolean escapeXml)
- Parameters:
props
- the HTML Cleaner properties set by the user to control the HTML cleaning.escapeXml
- if true then escape XML entities
DomSerializer
public DomSerializer(CleanerProperties props)
- Parameters:
props
- the HTML Cleaner properties set by the user to control the HTML cleaning.
createDOM
public Document createDOM(TagNode rootNode)
throws ParserConfigurationException
- Parameters:
rootNode
- the HTML Cleaner root node to serialize
- Returns:
- the W3C Document object
- Throws:
ParserConfigurationException
- if there's an error during serialization
isScriptOrStyle
protected boolean isScriptOrStyle(Element element)
- Parameters:
element
- the element to check
- Returns:
- true if the passed element is a script or style element
dontEscape
protected boolean dontEscape(Element element)
- encapsulate content with <[CDATA[ ]]> for things like script and style elements
- Parameters:
element
-
- Returns:
- true if <[CDATA[ ]]> should be used.
outputCData
protected String outputCData(CData cdata)
Copyright © 2006-2014. All Rights Reserved.