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 boolean
useIndentation
Indicates whether or not indent XML elements. -
Constructor Summary
Constructors Constructor Description XMLHelper()
-
Method Summary
Modifier and Type Method Description static String
getDelimiter()
Returns a string used to separate XML elements for better readability.static Document
getDocument(InputStream inpS)
static Document
getDocumentFromXMLstring(String res)
static org.jdom2.Document
getJDOMfromDOM(Document doc)
static String
getOuterXml(Node node)
static String
getOuterXmlPretty(Node n)
static Node
getXMLnodeFromString(String xmlString)
static String
spc(int n)
Returns a String containingn
spaces (or the empty String ifuseIndentation
is set tofalse
).static void
validate(Document doc, URL xsdLocation)
static void
writeXMLDataToFile(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 containingn
spaces (or the empty String ifuseIndentation
is 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:
IOException
TransformerException
org.jdom2.JDOMException
-
getJDOMfromDOM
-
getXMLnodeFromString
- Parameters:
xmlString
-- Returns:
-
getDocumentFromXMLstring
- Parameters:
res
-- Returns:
-
getDocument
-
validate
- Throws:
Exception
-
writeXMLDataToFile
-