Writes the closing tag to make the XML well formed.
Writes the closing tag to make the XML well formed.
EventWriter.prototype.close = function() {
this._out.write("</stream>");
};
module.exports = EventWriter;
})();
Writes an Event
object to the output stream specified in the constructor.
Name | Type | Description |
---|---|---|
event | Object | An |
EventWriter.prototype.writeEvent = function(event) {
if (!this._headerWritten) {
this._out.write("<stream>");
this._headerWritten = true;
}
try {
event._writeTo(this._out);
}
catch (e) {
if (e.message === "Events must have at least the data field set to be written to XML.") {
Logger.warn("", e.message, this._err);
throw e;
}
Logger.error("", e.message, this._err);
throw e;
}
};
Writes a string representation of an Elementtree
Object to the output stream specified in the constructor.
This function will throw an exception if there is an error while making a string from xmlDocument
, or while writing the string created from xmlDocument
.
Name | Type | Description |
---|---|---|
xmlDocument | Object | An |
EventWriter.prototype.writeXMLDocument = function(xmlDocument) {
var xmlString = ET.tostring(xmlDocument, {"xml_declaration": false});
this._out.write(xmlString);
};