Package xal.tools.xml
Class XmlWriter
java.lang.Object
xal.tools.xml.XmlWriter
XmlWriter is a class that can write an XML document to a desired output in
XML format. It only supports writing of Document, Element and Attribute
nodes. Other node support may be added as the need arises. XML writer is
quite generic for writing XML 1.0 documents with standard encoding.
This class mainly implements convenience methods for writing documents to
different outputs. The work of writing XML constructs to text is left to the
member classes.
- Author:
- tap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
write()
write the document to the instance's writerstatic void
writeToFile
(Document document, File file) Write the document to a filestatic void
writeToPath
(Document newDocument, String filePath) write the XML document to the UNIX file pathstatic String
writeToString
(Document newDocument) return a string representation of the XML documentstatic void
writeToUrl
(Document document, URL url) write the XML document to the URLstatic void
writeToUrlSpec
(Document newDocument, String urlSpec) write the XML document to the URL specstatic void
writeToWriter
(Document newDocument, Writer aWriter) write the XML document to the specified writer
-
Constructor Details
-
XmlWriter
Creates new XmlWriter
-
-
Method Details
-
writeToUrl
write the XML document to the URL- Throws:
IOException
-
writeToUrlSpec
write the XML document to the URL spec- Throws:
IOException
-
writeToPath
write the XML document to the UNIX file path- Throws:
IOException
-
writeToFile
Write the document to a file- Parameters:
document
- the document to writefile
- the file to be written- Throws:
IOException
-
writeToString
return a string representation of the XML document -
writeToWriter
write the XML document to the specified writer -
write
protected void write()write the document to the instance's writer
-