| java.lang.Object org.openharmonise.commons.xml.XMLPrettyPrint
XMLPrettyPrint | public class XMLPrettyPrint (Code) | | This class prints XML, formatted so that it is nicely indented and empty elements
are self-closing. It can print to a String or directly to a file, by passing it
either a java.io.File object or a path to the required output file.
author: Matthew Large |
XMLPrettyPrint | public XMLPrettyPrint()(Code) | | |
decodeXMLText | public String decodeXMLText(String sText)(Code) | | Handles XML decoding of text, e.g. & to &;.
Parameters: sText - Text to XML decode XML decoded text |
encodeXMLText | public String encodeXMLText(String sText)(Code) | | Handles XML encoding of text, e.g. & to &.
Parameters: sText - Text to XML encode XML Encoded text |
getNamespaceResolver | public NamespaceResolver getNamespaceResolver()(Code) | | Accessor to the current NamespaceResolver.
The NamespaceResolver that XMLPrettyPrint will use when printing namespaced XML. |
isNamespaceAware | public boolean isNamespaceAware()(Code) | | Method to check if XMLPrettyPrint is set to be Namespace Aware.
True if XMLPrettyPrint will deal with XML Namespaces |
printNode | public String printNode(Node node, boolean includeXMLDeclaration) throws NamespaceClashException(Code) | | Prints a given DOM Node to a String.
Parameters: node - DOM Node to print Parameters: includeXMLDeclaration - true if the XML declaration should be included at the top of the output String with output of printed DOM Node throws: NamespaceClashException - |
printNodeToFile | public void printNodeToFile(Node node, String sFilepath)(Code) | | Prints a given DOM Node to a File as specified by a path.
Parameters: node - DOM Node to print Parameters: sFilepath - Path of File to print DOM Node to |
printNodeToFile | public void printNodeToFile(Node node, File file)(Code) | | Prints a given DOM Node to a given File.
Parameters: node - DOM Node to print Parameters: file - File to print DOM Node to |
setNamespaceAware | public void setNamespaceAware(boolean bNamespaceAware)(Code) | | Sets whether XMLPrettyPrint will deal with XML Namespaces. If you are setting
XMLPrettyPrint to be Namespace Aware and you have not set a NamespaceResolver
then a XMLPrettyPrint will create a new local one, this can be overridden by
setting your own using setNamespaceResolver.
Parameters: bNamespaceAware - |
setNamespaceResolver | public void setNamespaceResolver(NamespaceResolver resolver)(Code) | | Sets the NamespaceResolver that XMLPrettyPrint will use when printing namespaced
XML. If the NamespaceResolver that is passed in is not null, XMLPrettyPrint will
automatically be set to be namespace aware. If the NamespaceResolver that is passed in is
null, then XMLPrettyPrint will be set to be namespace unaware and the currently
held resolver (if any) will be removed.
Parameters: resolver - The NamespaceResolver that XMLPrettyPrint is to use |
|
|