libSBML C# API  libSBML 5.13.0 C# API
libsbmlcs.XMLOutputStream Class Reference
Inheritance diagram for libsbmlcs.XMLOutputStream:
[legend]

Detailed Description

{core}

Interface to an XML output stream.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

SBML content is serialized using XML; the resulting data can be stored and read to/from a file or data stream. Low-level XML parsers such as Xerces provide facilities to read XML data. To permit the use of different XML parsers (Xerces, Expat or libxml2), libSBML implements an abstraction layer. XMLInputStream and XMLOutputStream are two parts of that abstraction layer.

XMLOutputStream provides a wrapper above output streams to facilitate writing XML. XMLOutputStream keeps track of start and end elements, indentation, XML namespace prefixes, and more. The interface provides features for converting non-text data types into appropriate textual form; this takes the form of overloaded writeAttribute(...) methods that allow users to simply use the same method with any data type. For example, suppose an element testElement has two attributes, size and id, and the attributes are variables in your code as follows: Then, the element and the attributes can be written to the standard output stream (provided as cout in the libSBML language bindings)as follows:

Other classes in SBML take XMLOutputStream objects as arguments, and use that to write elements and attributes seamlessly to the XML output stream.

It is also worth noting that unlike XMLInputStream, XMLOutputStream is actually independent of the underlying XML parsers. It does not use the XML parser libraries at all.

Note
The convenience of the XMLInputStream and XMLOutputStream abstraction may be useful for developers interested in creating parsers for other XML formats besides SBML. It can provide developers with a layer above more basic XML parsers, as well as some useful programmatic elements such as XMLToken, XMLError, etc.
See also
XMLInputStream

Public Member Functions

virtual void Dispose ()
 
void downIndent ()
 Decreases the indentation level for this XMLOutputStream. More...
 
void endElement (string name, string prefix)
 Writes the given XML end element name to this XMLOutputStream. More...
 
void endElement (string name)
 Writes the given XML end element name to this XMLOutputStream. More...
 
void endElement (XMLTriple triple)
 Writes the given element to the stream. More...
 
override bool Equals (Object sb)
 
override int GetHashCode ()
 
SBMLNamespaces getSBMLNamespaces ()
 Returns the SBMLNamespaces object attached to this output stream. More...
 
void setAutoIndent (bool indent)
 Turns automatic indentation on or off for this XMLOutputStream. More...
 
void setSBMLNamespaces (SBMLNamespaces sbmlns)
 Sets the SBMLNamespaces object associated with this output stream. More...
 
void startElement (string name, string prefix)
 Writes the given XML start element name to this XMLOutputStream. More...
 
void startElement (string name)
 Writes the given XML start element name to this XMLOutputStream. More...
 
void startElement (XMLTriple triple)
 Writes the given XML start element. More...
 
void startEndElement (string name, string prefix)
 Writes the given XML start and end element name to this XMLOutputStream. More...
 
void startEndElement (string name)
 Writes the given XML start and end element name to this XMLOutputStream. More...
 
void startEndElement (XMLTriple triple)
 Writes the given start element to this output stream. More...
 
void upIndent ()
 Increases the indentation level for this XMLOutputStream. More...
 
void writeAttribute (string name, string value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, string prefix, string value)
 Writes the given namespace-prefixed attribute value to this output stream. More...
 
void writeAttribute (XMLTriple triple, string value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, bool value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, string prefix, bool value)
 Writes the given namespace-prefixed attribute value to this output stream. More...
 
void writeAttribute (XMLTriple triple, bool value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, double value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, string prefix, double value)
 Writes the given namespace-prefixed attribute value to this output stream. More...
 
void writeAttribute (XMLTriple triple, double value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, int value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, string prefix, int value)
 Writes the given namespace-prefixed attribute value to this output stream. More...
 
void writeAttribute (XMLTriple triple, int value)
 Writes the given attribute and value to this output stream. More...
 
void writeAttribute (string name, string prefix, long value)
 Writes the given namespace-prefixed attribute value to this output stream. More...
 
void writeComment (string programName, string programVersion, bool writeTimestamp)
 Writes an XML comment with the name and version of this program. More...
 
void writeComment (string programName, string programVersion)
 Writes an XML comment with the name and version of this program. More...
 
void writeXMLDecl ()
 Writes a standard XML declaration to this output stream. More...
 
 XMLOutputStream (OStream stream, string encoding, bool writeXMLDecl, string programName, string programVersion)
 Creates a new XMLOutputStream that wraps the given stream. More...
 
 XMLOutputStream (OStream stream, string encoding, bool writeXMLDecl, string programName)
 Creates a new XMLOutputStream that wraps the given stream. More...
 
 XMLOutputStream (OStream stream, string encoding, bool writeXMLDecl)
 Creates a new XMLOutputStream that wraps the given stream. More...
 
 XMLOutputStream (OStream stream, string encoding)
 Creates a new XMLOutputStream that wraps the given stream. More...
 
 XMLOutputStream (OStream stream)
 Creates a new XMLOutputStream that wraps the given stream. More...
 

Static Public Member Functions

static string getLibraryName ()
 
static string getLibraryVersion ()
 
static bool getWriteComment ()
 
static bool getWriteTimestamp ()
 
static bool operator!= (XMLOutputStream lhs, XMLOutputStream rhs)
 
static bool operator== (XMLOutputStream lhs, XMLOutputStream rhs)
 
static void setLibraryName (string libraryName)
 sets the name of the library writing the XML More...
 
static void setLibraryVersion (string libraryVersion)
 sets the name of the library writing the output More...
 
static void setWriteComment (bool writeComment)
 sets a flag, whether the output stream will write an XML comment at the top of the file. More...
 
static void setWriteTimestamp (bool writeTimestamp)
 sets a flag, whether the output stream will write an XML comment with a timestamp at the top of the file. More...
 

Protected Attributes

bool swigCMemOwn
 

Constructor & Destructor Documentation

§ XMLOutputStream() [1/5]

libsbmlcs.XMLOutputStream.XMLOutputStream ( OStream  stream,
string  encoding,
bool  writeXMLDecl,
string  programName,
string  programVersion 
)

Creates a new XMLOutputStream that wraps the given stream.

The functionality associated with the programName and programVersion arguments concerns an optional comment that libSBML can write at the beginning of the output stream. The comment is intended for human readers of the XML file, and has the following form:

<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->

This program information comment is a separate item from the XML declaration that this method can also write to this output stream. The comment is also not mandated by any SBML specification. This libSBML functionality is provided for the convenience of calling programs, and to help humans trace the origin of SBML files.

The XML declaration has the form

<?xml version='1.0' encoding='UTF-8'?>

Note that the SBML specifications require the use of UTF-8 encoding and version 1.0, so for SBML documents, the above is the standard XML declaration.

Parameters
streamthe input stream to wrap.
encodingthe XML encoding to declare in the output. This value should be 'UTF-8' for SBML documents. The default value is 'UTF-8' if no value is supplied for this parameter.
writeXMLDeclwhether to write a standard XML declaration at the beginning of the content written on stream. The default is true.
programNamean optional program name to write as a comment in the output stream.
programVersionan optional version identification string to write as a comment in the output stream.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ XMLOutputStream() [2/5]

libsbmlcs.XMLOutputStream.XMLOutputStream ( OStream  stream,
string  encoding,
bool  writeXMLDecl,
string  programName 
)

Creates a new XMLOutputStream that wraps the given stream.

The functionality associated with the programName and programVersion arguments concerns an optional comment that libSBML can write at the beginning of the output stream. The comment is intended for human readers of the XML file, and has the following form:

<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->

This program information comment is a separate item from the XML declaration that this method can also write to this output stream. The comment is also not mandated by any SBML specification. This libSBML functionality is provided for the convenience of calling programs, and to help humans trace the origin of SBML files.

The XML declaration has the form

<?xml version='1.0' encoding='UTF-8'?>

Note that the SBML specifications require the use of UTF-8 encoding and version 1.0, so for SBML documents, the above is the standard XML declaration.

Parameters
streamthe input stream to wrap.
encodingthe XML encoding to declare in the output. This value should be 'UTF-8' for SBML documents. The default value is 'UTF-8' if no value is supplied for this parameter.
writeXMLDeclwhether to write a standard XML declaration at the beginning of the content written on stream. The default is true.
programNamean optional program name to write as a comment in the output stream.
programVersionan optional version identification string to write as a comment in the output stream.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ XMLOutputStream() [3/5]

libsbmlcs.XMLOutputStream.XMLOutputStream ( OStream  stream,
string  encoding,
bool  writeXMLDecl 
)

Creates a new XMLOutputStream that wraps the given stream.

The functionality associated with the programName and programVersion arguments concerns an optional comment that libSBML can write at the beginning of the output stream. The comment is intended for human readers of the XML file, and has the following form:

<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->

This program information comment is a separate item from the XML declaration that this method can also write to this output stream. The comment is also not mandated by any SBML specification. This libSBML functionality is provided for the convenience of calling programs, and to help humans trace the origin of SBML files.

The XML declaration has the form

<?xml version='1.0' encoding='UTF-8'?>

Note that the SBML specifications require the use of UTF-8 encoding and version 1.0, so for SBML documents, the above is the standard XML declaration.

Parameters
streamthe input stream to wrap.
encodingthe XML encoding to declare in the output. This value should be 'UTF-8' for SBML documents. The default value is 'UTF-8' if no value is supplied for this parameter.
writeXMLDeclwhether to write a standard XML declaration at the beginning of the content written on stream. The default is true.
programNamean optional program name to write as a comment in the output stream.
programVersionan optional version identification string to write as a comment in the output stream.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ XMLOutputStream() [4/5]

libsbmlcs.XMLOutputStream.XMLOutputStream ( OStream  stream,
string  encoding 
)

Creates a new XMLOutputStream that wraps the given stream.

The functionality associated with the programName and programVersion arguments concerns an optional comment that libSBML can write at the beginning of the output stream. The comment is intended for human readers of the XML file, and has the following form:

<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->

This program information comment is a separate item from the XML declaration that this method can also write to this output stream. The comment is also not mandated by any SBML specification. This libSBML functionality is provided for the convenience of calling programs, and to help humans trace the origin of SBML files.

The XML declaration has the form

<?xml version='1.0' encoding='UTF-8'?>

Note that the SBML specifications require the use of UTF-8 encoding and version 1.0, so for SBML documents, the above is the standard XML declaration.

Parameters
streamthe input stream to wrap.
encodingthe XML encoding to declare in the output. This value should be 'UTF-8' for SBML documents. The default value is 'UTF-8' if no value is supplied for this parameter.
writeXMLDeclwhether to write a standard XML declaration at the beginning of the content written on stream. The default is true.
programNamean optional program name to write as a comment in the output stream.
programVersionan optional version identification string to write as a comment in the output stream.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ XMLOutputStream() [5/5]

libsbmlcs.XMLOutputStream.XMLOutputStream ( OStream  stream)

Creates a new XMLOutputStream that wraps the given stream.

The functionality associated with the programName and programVersion arguments concerns an optional comment that libSBML can write at the beginning of the output stream. The comment is intended for human readers of the XML file, and has the following form:

<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->

This program information comment is a separate item from the XML declaration that this method can also write to this output stream. The comment is also not mandated by any SBML specification. This libSBML functionality is provided for the convenience of calling programs, and to help humans trace the origin of SBML files.

The XML declaration has the form

<?xml version='1.0' encoding='UTF-8'?>

Note that the SBML specifications require the use of UTF-8 encoding and version 1.0, so for SBML documents, the above is the standard XML declaration.

Parameters
streamthe input stream to wrap.
encodingthe XML encoding to declare in the output. This value should be 'UTF-8' for SBML documents. The default value is 'UTF-8' if no value is supplied for this parameter.
writeXMLDeclwhether to write a standard XML declaration at the beginning of the content written on stream. The default is true.
programNamean optional program name to write as a comment in the output stream.
programVersionan optional version identification string to write as a comment in the output stream.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

Member Function Documentation

§ Dispose()

virtual void libsbmlcs.XMLOutputStream.Dispose ( )
virtual

§ downIndent()

void libsbmlcs.XMLOutputStream.downIndent ( )

Decreases the indentation level for this XMLOutputStream.

LibSBML tries to produce human-readable XML output by automatically indenting the bodies of elements. Callers can manually control indentation further by using the XMLOutputStream::upIndent() and XMLOutputStream::downIndent() methods to increase and decrease, respectively, the current level of indentation in the XML output.

See also
upIndent()

§ endElement() [1/3]

void libsbmlcs.XMLOutputStream.endElement ( string  name,
string  prefix 
)

Writes the given XML end element name to this XMLOutputStream.

Parameters
namethe name of the element.
prefixan optional XML namespace prefix to write in front of the element name. (The result has the form prefix:name.)
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ endElement() [2/3]

void libsbmlcs.XMLOutputStream.endElement ( string  name)

Writes the given XML end element name to this XMLOutputStream.

Parameters
namethe name of the element.
prefixan optional XML namespace prefix to write in front of the element name. (The result has the form prefix:name.)
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ endElement() [3/3]

void libsbmlcs.XMLOutputStream.endElement ( XMLTriple  triple)

Writes the given element to the stream.

Parameters
triplethe XML element to write.

§ Equals()

override bool libsbmlcs.XMLOutputStream.Equals ( Object  sb)

§ GetHashCode()

override int libsbmlcs.XMLOutputStream.GetHashCode ( )

§ getLibraryName()

static string libsbmlcs.XMLOutputStream.getLibraryName ( )
static
Returns
the name of the library to be used in comments ('libSBML' by default)

§ getLibraryVersion()

static string libsbmlcs.XMLOutputStream.getLibraryVersion ( )
static
Returns
a string representing the version of the library writing the output. This is the value of getLibSBMLDottedVersion() by default.

§ getSBMLNamespaces()

SBMLNamespaces libsbmlcs.XMLOutputStream.getSBMLNamespaces ( )

Returns the SBMLNamespaces object attached to this output stream.

Returns
the SBMLNamespaces object, or null if none has been set.

§ getWriteComment()

static bool libsbmlcs.XMLOutputStream.getWriteComment ( )
static
Returns
a boolean, whether the output stream will write an XML comment at the top of the file. (Enabled by default)

§ getWriteTimestamp()

static bool libsbmlcs.XMLOutputStream.getWriteTimestamp ( )
static
Returns
a boolean, whether the output stream will write an XML comment with a timestamp at the top of the file. (Enabled by default)

§ operator!=()

static bool libsbmlcs.XMLOutputStream.operator!= ( XMLOutputStream  lhs,
XMLOutputStream  rhs 
)
static

§ operator==()

static bool libsbmlcs.XMLOutputStream.operator== ( XMLOutputStream  lhs,
XMLOutputStream  rhs 
)
static

§ setAutoIndent()

void libsbmlcs.XMLOutputStream.setAutoIndent ( bool  indent)

Turns automatic indentation on or off for this XMLOutputStream.

Parameters
indentif true, automatic indentation is turned on.

§ setLibraryName()

static void libsbmlcs.XMLOutputStream.setLibraryName ( string  libraryName)
static

sets the name of the library writing the XML

Parameters
libraryNamethe name of the library to be used in comments

§ setLibraryVersion()

static void libsbmlcs.XMLOutputStream.setLibraryVersion ( string  libraryVersion)
static

sets the name of the library writing the output

Parameters
libraryVersionthe version information as string

§ setSBMLNamespaces()

void libsbmlcs.XMLOutputStream.setSBMLNamespaces ( SBMLNamespaces  sbmlns)

Sets the SBMLNamespaces object associated with this output stream.

Parameters
sbmlnsthe namespace object.

§ setWriteComment()

static void libsbmlcs.XMLOutputStream.setWriteComment ( bool  writeComment)
static

sets a flag, whether the output stream will write an XML comment at the top of the file.

(Enabled by default)

Parameters
writeCommentthe flag

§ setWriteTimestamp()

static void libsbmlcs.XMLOutputStream.setWriteTimestamp ( bool  writeTimestamp)
static

sets a flag, whether the output stream will write an XML comment with a timestamp at the top of the file.

(Enabled by default)

Parameters
writeTimestampthe flag

§ startElement() [1/3]

void libsbmlcs.XMLOutputStream.startElement ( string  name,
string  prefix 
)

Writes the given XML start element name to this XMLOutputStream.

Parameters
namethe name of the element.
prefixan optional XML namespace prefix to write in front of the element name. (The result has the form prefix:name.)
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ startElement() [2/3]

void libsbmlcs.XMLOutputStream.startElement ( string  name)

Writes the given XML start element name to this XMLOutputStream.

Parameters
namethe name of the element.
prefixan optional XML namespace prefix to write in front of the element name. (The result has the form prefix:name.)
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ startElement() [3/3]

void libsbmlcs.XMLOutputStream.startElement ( XMLTriple  triple)

Writes the given XML start element.

prefix:name on this output stream.

Parameters
triplethe start element to write.

§ startEndElement() [1/3]

void libsbmlcs.XMLOutputStream.startEndElement ( string  name,
string  prefix 
)

Writes the given XML start and end element name to this XMLOutputStream.

Parameters
namethe name of the element.
prefixan optional XML namespace prefix to write in front of the element name. (The result has the form prefix:name.)
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ startEndElement() [2/3]

void libsbmlcs.XMLOutputStream.startEndElement ( string  name)

Writes the given XML start and end element name to this XMLOutputStream.

Parameters
namethe name of the element.
prefixan optional XML namespace prefix to write in front of the element name. (The result has the form prefix:name.)
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.

§ startEndElement() [3/3]

void libsbmlcs.XMLOutputStream.startEndElement ( XMLTriple  triple)

Writes the given start element to this output stream.

Parameters
triplethe XML element to write.

§ upIndent()

void libsbmlcs.XMLOutputStream.upIndent ( )

Increases the indentation level for this XMLOutputStream.

LibSBML tries to produce human-readable XML output by automatically indenting the bodies of elements. Callers can manually control indentation further by using the XMLOutputStream::upIndent() and XMLOutputStream::downIndent() methods to increase and decrease, respectively, the current level of indentation in the XML output.

See also
downIndent()

§ writeAttribute() [1/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
string  value 
)

Writes the given attribute and value to this output stream.

Parameters
namethe name of the attribute.
valuethe value of the attribute.

§ writeAttribute() [2/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
string  prefix,
string  value 
)

Writes the given namespace-prefixed attribute value to this output stream.

Parameters
namethe name of the attribute.
prefixan XML namespace prefix to write in front of the element name. (The result has the form prefix:name.) See other versions of this method for a variant that does not require a prefix.
valuethe value of the attribute.

§ writeAttribute() [3/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( XMLTriple  triple,
string  value 
)

Writes the given attribute and value to this output stream.

Parameters
triplethe attribute, in the form of an XMLTriple.
valuethe value of the attribute.

§ writeAttribute() [4/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
bool  value 
)

Writes the given attribute and value to this output stream.

Parameters
namethe name of the attribute.
valuethe value of the attribute.

§ writeAttribute() [5/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
string  prefix,
bool  value 
)

Writes the given namespace-prefixed attribute value to this output stream.

Parameters
namethe name of the attribute.
prefixan XML namespace prefix to write in front of the element name. (The result has the form prefix:name.) See other versions of this method for a variant that does not require a prefix.
valuethe value of the attribute.

§ writeAttribute() [6/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( XMLTriple  triple,
bool  value 
)

Writes the given attribute and value to this output stream.

Parameters
triplethe attribute, in the form of an XMLTriple.
valuethe value of the attribute.

§ writeAttribute() [7/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
double  value 
)

Writes the given attribute and value to this output stream.

Parameters
namethe name of the attribute.
valuethe value of the attribute.

§ writeAttribute() [8/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
string  prefix,
double  value 
)

Writes the given namespace-prefixed attribute value to this output stream.

Parameters
namethe name of the attribute.
prefixan XML namespace prefix to write in front of the element name. (The result has the form prefix:name.) See other versions of this method for a variant that does not require a prefix.
valuethe value of the attribute.

§ writeAttribute() [9/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( XMLTriple  triple,
double  value 
)

Writes the given attribute and value to this output stream.

Parameters
triplethe attribute, in the form of an XMLTriple.
valuethe value of the attribute.

§ writeAttribute() [10/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
int  value 
)

Writes the given attribute and value to this output stream.

Parameters
namethe name of the attribute.
valuethe value of the attribute.

§ writeAttribute() [11/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
string  prefix,
int  value 
)

Writes the given namespace-prefixed attribute value to this output stream.

Parameters
namethe name of the attribute.
prefixan XML namespace prefix to write in front of the element name. (The result has the form prefix:name.) See other versions of this method for a variant that does not require a prefix.
valuethe value of the attribute.

§ writeAttribute() [12/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( XMLTriple  triple,
int  value 
)

Writes the given attribute and value to this output stream.

Parameters
triplethe attribute, in the form of an XMLTriple.
valuethe value of the attribute.

§ writeAttribute() [13/13]

void libsbmlcs.XMLOutputStream.writeAttribute ( string  name,
string  prefix,
long  value 
)

Writes the given namespace-prefixed attribute value to this output stream.

Parameters
namethe name of the attribute.
prefixan XML namespace prefix to write in front of the element name. (The result has the form prefix:name.) See other versions of this method for a variant that does not require a prefix.
valuethe value of the attribute.

§ writeComment() [1/2]

void libsbmlcs.XMLOutputStream.writeComment ( string  programName,
string  programVersion,
bool  writeTimestamp 
)

Writes an XML comment with the name and version of this program.

The XML comment has the following form:

<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->

See the class constructor for more information about this program comment.

Parameters
programNamean optional program name to write as a comment in the output stream.
programVersionan optional version identification string to write as a comment in the output stream.
writeTimestampan optional flag indicating that a timestamp should be written

§ writeComment() [2/2]

void libsbmlcs.XMLOutputStream.writeComment ( string  programName,
string  programVersion 
)

Writes an XML comment with the name and version of this program.

The XML comment has the following form:

<!-- Created by <program name> version <program version>
on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. -->

See the class constructor for more information about this program comment.

Parameters
programNamean optional program name to write as a comment in the output stream.
programVersionan optional version identification string to write as a comment in the output stream.
writeTimestampan optional flag indicating that a timestamp should be written

§ writeXMLDecl()

void libsbmlcs.XMLOutputStream.writeXMLDecl ( )

Writes a standard XML declaration to this output stream.

The XML declaration has the form

<?xml version='1.0' encoding='UTF-8'?>

Note that the SBML specifications require the use of UTF-8 encoding and version 1.0, so for SBML documents, the above is the standard XML declaration.

Member Data Documentation

§ swigCMemOwn

bool libsbmlcs.XMLOutputStream.swigCMemOwn
protected