Package org.graffiti.plugin
Class XMLHelper
java.lang.Object
org.graffiti.plugin.XMLHelper
- All Implemented Interfaces:
HelperClass
public class XMLHelper extends Object implements HelperClass
Contains some (static) auxiliary methods for writing XML.
-
Field Summary
Fields Modifier and Type Field Description static booleanuseIndentationIndicates whether or not indent XML elements. -
Constructor Summary
Constructors Constructor Description XMLHelper() -
Method Summary
Modifier and Type Method Description static StringgetDelimiter()Returns a string used to separate XML elements for better readability.static DocumentgetDocument(InputStream inpS)static DocumentgetDocumentFromXMLstring(String res)static org.jdom2.DocumentgetJDOMfromDOM(Document doc)static StringgetOuterXml(Node node)static StringgetOuterXmlPretty(Node n)static NodegetXMLnodeFromString(String xmlString)static Stringspc(int n)Returns a String containingnspaces (or the empty String ifuseIndentationis set tofalse).static voidvalidate(Document doc, URL xsdLocation)static voidwriteXMLDataToFile(Document doc, String path_and_filename)
-
Field Details
-
useIndentation
public static boolean useIndentationIndicates whether or not indent XML elements.
-
-
Constructor Details
-
XMLHelper
public XMLHelper()
-
-
Method Details
-
getDelimiter
Returns a string used to separate XML elements for better readability.- Returns:
- XML element delimiter string
-
spc
Returns a String containingnspaces (or the empty String ifuseIndentationis set tofalse).- Parameters:
n- number of spaces- Returns:
- DOCUMENT ME!
-
getOuterXml
- Throws:
TransformerException
-
getOuterXmlPretty
public static String getOuterXmlPretty(Node n) throws IOException, TransformerException, org.jdom2.JDOMException- Throws:
IOExceptionTransformerExceptionorg.jdom2.JDOMException
-
getJDOMfromDOM
-
getXMLnodeFromString
- Parameters:
xmlString-- Returns:
-
getDocumentFromXMLstring
- Parameters:
res-- Returns:
-
getDocument
-
validate
- Throws:
Exception
-
writeXMLDataToFile
-