Class XMLWriterClass
- Namespace
- ESRI.ArcGIS.esriSystem
- Assembly
- ESRI.Server.System.dll
[ClassInterface(ClassInterfaceType.None)]
[Guid("105A5345-85F8-4B27-A1D2-5D2262C6D27E")]
public class XMLWriterClass : XMLWriter, IXMLWriter2, IXMLWriter, ISupportErrorInfo
- Inheritance
-
XMLWriterClass
- Implements
- Inherited Members
Constructors
XMLWriterClass()
public XMLWriterClass()
Explicit Interface Implementations
IXMLWriter2_LookupNamespace(string)
virtual string IXMLWriter2_LookupNamespace(string uri)
Parameters
uristring
Returns
IXMLWriter2_WriteBinary(ref byte[])
virtual void IXMLWriter2_WriteBinary(ref byte[] Value)
Parameters
Valuebyte[]
IXMLWriter2_WriteBoolean(bool)
virtual void IXMLWriter2_WriteBoolean(bool Value)
Parameters
Valuebool
IXMLWriter2_WriteByte(byte)
virtual void IXMLWriter2_WriteByte(byte Value)
Parameters
Valuebyte
IXMLWriter2_WriteCData(string)
virtual void IXMLWriter2_WriteCData(string cdata)
Parameters
cdatastring
IXMLWriter2_WriteDate(DateTime)
virtual void IXMLWriter2_WriteDate(DateTime Value)
Parameters
ValueDateTime
IXMLWriter2_WriteDouble(double)
virtual void IXMLWriter2_WriteDouble(double Value)
Parameters
Valuedouble
IXMLWriter2_WriteEndTag()
virtual void IXMLWriter2_WriteEndTag()
IXMLWriter2_WriteFloat(float)
virtual void IXMLWriter2_WriteFloat(float Value)
Parameters
Valuefloat
IXMLWriter2_WriteInteger(int)
virtual void IXMLWriter2_WriteInteger(int Value)
Parameters
Valueint
IXMLWriter2_WriteNewLine()
virtual void IXMLWriter2_WriteNewLine()
IXMLWriter2_WriteShort(short)
virtual void IXMLWriter2_WriteShort(short Value)
Parameters
Valueshort
IXMLWriter2_WriteStartTag(string, string, IXMLAttributes, IXMLNamespaces, bool)
virtual void IXMLWriter2_WriteStartTag(string LocalName, string uri, IXMLAttributes Attributes, IXMLNamespaces namespaces, bool isEmpty)
Parameters
LocalNamestringuristringAttributesIXMLAttributesnamespacesIXMLNamespacesisEmptybool
IXMLWriter2_WriteTab()
virtual void IXMLWriter2_WriteTab()
IXMLWriter2_WriteText(string)
virtual void IXMLWriter2_WriteText(string Text)
Parameters
Textstring
IXMLWriter2_WriteTo(IStream)
virtual void IXMLWriter2_WriteTo(IStream outputStream)
Parameters
outputStreamIStream
IXMLWriter2_WriteVariant(object)
virtual void IXMLWriter2_WriteVariant(object Value)
Parameters
Valueobject
IXMLWriter2_WriteXML(string)
virtual void IXMLWriter2_WriteXML(string XML)
Parameters
XMLstring
IXMLWriter2_WriteXMLDeclaration()
virtual void IXMLWriter2_WriteXMLDeclaration()
InterfaceSupportsErrorInfo(ref Guid)
virtual void InterfaceSupportsErrorInfo(ref Guid riid)
Parameters
riidGuid
LookupNamespace(string)
Obtains the declared namespace prefix for a namespace.
virtual string LookupNamespace(string uri)
Parameters
uristring
Returns
Stream
Obtains underlying stream. If WriteTo() is not called yet, will return NULL.
virtual IStream Stream { get; }
Returns
WriteBinary(ref byte[])
Writes an element value as a binary array.
virtual void WriteBinary(ref byte[] Value)
Parameters
Valuebyte[]
Remarks
The WriteBinary method writes an element value as a binary array.
WriteBoolean(bool)
Writes an element value as a boolean.
virtual void WriteBoolean(bool Value)
Parameters
Valuebool
WriteByte(byte)
Writes an element value as a byte.
virtual void WriteByte(byte Value)
Parameters
Valuebyte
WriteCData(string)
Writes a CDATA section.
virtual void WriteCData(string cdata)
Parameters
cdatastring
Remarks
All text inside XML document is parsed by the XML parser. Only the text inside the CDATA section is ignored by the parser. If your text has lots of "<", ">", "&", "'", and "" (like program code), it could be hidden in CDATA section.
For example,
<test>
<![CDATA[
if a > b & b > c, then a > c
]]>
</test>
In the example above, everything inside CDATA section was ignored by the parser. It would show <test>if a > b & b > c, then a > c</test> in any web browser.
Example of creating such CDATA section using IXMLWriter:
Dim pXMLStream as IXMLStream
Set pXMLStream = new XMLStream
Dim pXMLWriter as IXMLWriter
Set pXMLWriter = new XMLWriter
pXMLWriter.WriteTo pXMLStream
pXMLWriter.WriteCData "if a > b & b > c, then a > c"
WriteDate(DateTime)
Writes an element value as a date.
virtual void WriteDate(DateTime Value)
Parameters
ValueDateTime
WriteDouble(double)
Writes an element value as a double.
virtual void WriteDouble(double Value)
Parameters
Valuedouble
WriteEndTag()
Writes the ending tag of an element.
virtual void WriteEndTag()
WriteFloat(float)
Writes an element value as a float.
virtual void WriteFloat(float Value)
Parameters
Valuefloat
WriteInt64(long)
Writes an element value as an int64.
virtual void WriteInt64(long Value)
Parameters
Valuelong
WriteInteger(int)
Writes an element value as a long.
virtual void WriteInteger(int Value)
Parameters
Valueint
WriteNewLine()
Writes a newline.
virtual void WriteNewLine()
WriteShort(short)
Writes an element value as a short.
virtual void WriteShort(short Value)
Parameters
Valueshort
WriteStartTag(string, string, IXMLAttributes, IXMLNamespaces, bool)
Writes the starting tag of an element.
virtual void WriteStartTag(string LocalName, string uri, IXMLAttributes Attributes, IXMLNamespaces namespaces, bool isEmpty)
Parameters
LocalNamestringuristringAttributesIXMLAttributesnamespacesIXMLNamespacesisEmptybool
Remarks
The WriteStartTag method specifies the starting tag of an element.
For example:
<Length>
WriteTab()
Writes a tab.
virtual void WriteTab()
WriteText(string)
Writes the text value of an element.
virtual void WriteText(string Text)
Parameters
Textstring
Remarks
The WriteText method writes the text value of an element.
WriteTo(IStream)
Specifies output XML stream.
virtual void WriteTo(IStream outputStream)
Parameters
outputStreamIStream
Remarks
The WriteTo method specifies the output XML stream. XMLStream lets you write/read (in our case write) xml data to stream object.
For Example:
Dim pWriter As IXMLWriter
Set pWriter = New XMLWriter
Dim pXMLStream as IXMLStream
Set pXMLStream = new XMLStream
'*** This sets output to XML Stream ***
pWriter.WriteTo pStream
'*** Write some xml to the stream ***
pWriter.WriteXMLDeclaration
'*** Save stream to the file ***
pXMLStream.SaveToFile App.Path & "\new.xml"
WriteVariant(object)
Writes an element value as a variant.
virtual void WriteVariant(object Value)
Parameters
Valueobject
Remarks
The WriteVariant method writes an element value as a variant.
WriteXML(string)
Writes raw XML.
virtual void WriteXML(string XML)
Parameters
XMLstring
Remarks
The RawXML method writes XML code to Stream object. The XML code should be well-formed and valid, otherwise the XMLReader will raise error if the Stream is going to be read afterwards.
WriteXMLDeclaration()
Writes the XML document declaration.
virtual void WriteXMLDeclaration()
Remarks
The WriteXMLDeclaration writes
<?xml version="1.0" encoding="utf-8" ?>
to Stream object. XML Declaration should always be included, as it defines the XML version and the encoding of the document.