XmlWriter

XmlWriter XmlWriter ( String fileName, String rootElementName ) (enterprise edition only)
XmlWriter XmlWriter ( String fileName, String rootElementName, String rootElementText ) (enterprise edition only)
XmlWriter XmlWriter ( String fileName, String rootElementName, String rootElementText, Hashtable attributes ) (enterprise edition only)
XmlWriter XmlWriter ( String fileName, String rootElementName, String rootElementText, Hashtable attributes, String characterSet ) (enterprise edition only)

Description

Initiate a XmlWriter object.

Parameters

  • fileName The file path where the file will be created, as a string.
  • rootElementName The root element's name in the XML file, as a string.
  • rootElementText (optional) Any text to be added inside of the root node, as a string.
  • attributes (optional) Hashtable of attribute names and their associated values, for the root node.

Return Values

Returns a XmlWriter. If an error is experienced it will be thrown.

Change Log

Version Description
4.5 Available for enterprise edition.
5.5.3a Added the constructor that takes a character set.

Class Location

com.screenscraper.xml.XmlWriter

Examples

Create an XmlWriter

 // Import package
import com.screenscraper.xml.*;

 // Create XmlWriter
 xmlWriter = new XmlWriter( "C:/students.xml", "students" );