public class SimpleXML
extends java.lang.Object
Constructor and Description |
---|
SimpleXML() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Document |
addRootComment(org.w3c.dom.Document document,
java.lang.String commentText)
Adds the root comment.
|
static org.w3c.dom.Element |
createElement(org.w3c.dom.Document document,
org.w3c.dom.Element parent,
java.lang.String key,
java.lang.String value)
Creates the element.
|
static org.w3c.dom.Document |
documentFromString(java.lang.String xmlString)
Document from string.
|
static java.lang.String |
flattenString(java.lang.String output)
Flatten string.
|
static java.lang.String |
getXMLasString(org.w3c.dom.Document document)
Gets the xM las string.
|
static org.w3c.dom.Document |
makeXMLDocument(java.lang.String rootName)
Make xml document.
|
static void |
writeXmlFile(org.w3c.dom.Document doc,
java.io.File saveFile,
boolean systemOut)
Write xml file.
|
public static org.w3c.dom.Document makeXMLDocument(java.lang.String rootName) throws java.lang.Exception
rootName
- the root namejava.lang.Exception
- the exceptionpublic static org.w3c.dom.Document addRootComment(org.w3c.dom.Document document, java.lang.String commentText)
document
- the documentcommentText
- the comment textpublic static org.w3c.dom.Element createElement(org.w3c.dom.Document document, org.w3c.dom.Element parent, java.lang.String key, java.lang.String value)
document
- the documentparent
- the parentkey
- the keyvalue
- the valuepublic static java.lang.String getXMLasString(org.w3c.dom.Document document) throws javax.xml.transform.TransformerException
document
- the documentjavax.xml.transform.TransformerException
- the transformer exceptionpublic static void writeXmlFile(org.w3c.dom.Document doc, java.io.File saveFile, boolean systemOut)
doc
- the docsaveFile
- the save filesystemOut
- the system outpublic static org.w3c.dom.Document documentFromString(java.lang.String xmlString) throws java.io.IOException, org.xml.sax.SAXException
xmlString
- the xml stringjava.io.IOException
- Signals that an I/O exception has occurred.org.xml.sax.SAXException
- the sAX exceptionpublic static java.lang.String flattenString(java.lang.String output)
output
- the output