Package PamUtils
Class XMLUtils
java.lang.Object
PamUtils.XMLUtils
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentCreates a blank Document object, or returns null if there was an errorstatic DocumentcreateDocument(File xmlFile) Create an xml document from an xml file.static DocumentcreateDocument(String xmlFileName) Create an xml document from an xml file.static StringgetAsString(Document doc) Get the xml document as a String.static DocumentgetDocumentFromString(String xmlString) Convert a string back into an XML document.static DoublegetDoubleValue(Element el, String name) Get a Double attribute from an Elementstatic IntegergetIntegerValue(Element el, String name) Get an integer attribute from an Elementstatic StringConvert an xml document to a String.static voidwriteToFile(Document doc, File outFile) Write to the given file. 
- 
Constructor Details
- 
XMLUtils
public XMLUtils() 
 - 
 - 
Method Details
- 
getStringFromDocument
Convert an xml document to a String.- Parameters:
 doc- xml document
 - 
getDocumentFromString
Convert a string back into an XML document.- Parameters:
 xmlString- String- Returns:
 - XML Document, or null if there was an error
 
 - 
getIntegerValue
Get an integer attribute from an Element- Parameters:
 el- XML Elementname- Attribute name- Returns:
 - null if not a number
 
 - 
getDoubleValue
Get a Double attribute from an Element- Parameters:
 el- XML Elementname- Attribute name- Returns:
 - null if not a number
 
 - 
createBlankDoc
Creates a blank Document object, or returns null if there was an error- Returns:
 
 - 
createDocument
Create an xml document from an xml file.- Parameters:
 xmlFileName- xml file name- Returns:
 - document
 
 - 
createDocument
Create an xml document from an xml file.- Parameters:
 xmlFile- xml file- Returns:
 - document
 
 - 
writeToFile
Write to the given file.- Parameters:
 doc- xml documentoutFile- file- Throws:
 IOException
 - 
getAsString
Get the xml document as a String.- Parameters:
 doc- xml document- Returns:
 - xml content as a a string.
 
 
 -