Unicorn XML Toolkit
Version 1.00.00

Namespace XmlWriter
Class CXmlWriter

class CXmlWriter: public Sax::CContentHandler {
public:
    CXmlWriter();
    virtual ~CXmlWriter();
public:
    virtual bool GetUri(CString &strUri) = 0;
    virtual bool GetNamespaces(bool &bNamespaces) = 0;
    virtual bool GetMethod(
        CString &strNamespaceUri, 
        CString &strLocalName) = 0;
    virtual bool GetVersion(CString &strVersion) = 0;
    virtual bool GetEncoding(CString &strEncoding) = 0;
    virtual bool GetOmitXmlDeclaration(
        bool &bOmitXmlDeclaration) = 0;
    virtual bool GetStandalone(bool &bStandalone) = 0;
    virtual bool GetDoctypePublic(CString &strDoctypePublic) = 0;
    virtual bool GetDoctypeSystem(CString &strDoctypeSystem) = 0;
    virtual bool GetIndent(bool &bIndent) = 0;
    virtual bool GetMediaType(CString &strMediaType) = 0;
public:
    virtual void SetUri(const CString &strUri) = 0;
    virtual void SetNamespaces(bool bNamespaces) = 0;
    virtual void SetMethod(
        const CString &strNamespaceUri,
        const CString &strLocalName) = 0;
    virtual void SetVersion(const CString &strVersion) = 0;
    virtual void SetEncoding(const CString &strEncoding) = 0;
    virtual void SetOmitXmlDeclaration(bool bOmitXmlDeclaration) = 0;
    virtual void SetStandalone(bool bStandalone) = 0;
    virtual void SetDoctypePublic(
        const CString &strDoctypePublic) = 0;
    virtual void SetDoctypeSystem(
        const CString &strDoctypeSystem) = 0;
    virtual void SetIndent(bool bIndent) = 0;
    virtual void SetMediaType(const CString &strMediaType) = 0;
    };

The abstract interface to XML writers.

XML writer is represented as the subclass of SAX content handler (see Sax::CContentHandler ). It accepts the stream of XML content events as input. The application programmer must specify whether the input stream is expected to perform namespace processing (see Sax for the detailed discussion of the namespace processing in SAX).

XML writer generates the output text stream in the specified format and sends it to the specified target URI.

XML writer engine is modelled after the output facility specified in XSL Transformations (XSLT) Version 1.0.

In particular, every XML writer owns a collection of properties corresponding to various attributes specified for XSLT xsl:output element. For each property the CXmlWriter class provides a pair of member functions designed to get or set the property value. Each property may be assigned a particular value, or may be undefined.

Following is the complete list of writer properties. Refer to XSL Transformations (XSLT) Version 1.0 for the detailed description of semantics of these properties.

Additionaly, there are two writer properties which have no equivalent in XSLT:

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
Constructor/Destructor Summary
CXmlWriter ();
����������Constructs the XML writer.
~CXmlWriter ();
����������Destroys the XML writer.

Function Summary
bool GetUri (CString &strUri);
����������Queries the target URI.
bool GetNamespaces (bool &bNamespaces);
����������Queries the namespace processing indicator.
bool GetMethod (CString &strNamespaceUri, CString &strLocalName);
����������Queries the name of the output method.
bool GetVersion (CString &strVersion);
����������Queries the version of the output method.
bool GetEncoding (CString &strEncoding);
����������Queries the preferred character encoding.
bool GetOmitXmlDeclaration (bool &bOmitXmlDeclaration);
����������Queries the omit XML declaration indicator.
bool GetStandalone (bool &bStandalone);
����������Queries the standalone indicator.
bool GetDoctypePublic (CString &strDoctypePublic);
����������Queries the document type system identifier.
bool GetDoctypeSystem (CString &strDoctypeSystem);
����������Queries the document type public identifier.
bool GetIndent (bool &bIndent);
����������Queries the indent indicator.
bool GetMediaType (CString &strMediaType);
����������Queries the media type.
void SetUri (const CString &strUri);
����������Sets the target URI.
void SetNamespaces (bool bNamespaces);
����������Sets the namepace processing indicator.
void SetMethod (const CString &strNamespaceUri, const CString &strLocalName);
����������Sets the name of the output method.
void SetVersion (const CString &strVersion);
����������Sets the version of the output method.
void SetEncoding (const CString &strEncoding);
����������Sets the preferred character encoding.
void SetOmitXmlDeclaration (bool bOmitXmlDeclaration);
����������Sets the omit XML declaration indicator.
void SetStandalone (bool bStandalone);
����������Sets the standalone indicator.
void SetDoctypePublic (const CString &strDoctypePublic);
����������Sets the document type public identifier.
void SetDoctypeSystem (const CString &strDoctypeSystem);
����������Sets the document type system identifier.
void SetIndent (bool bIndent);
����������Sets the indent indicator.
void SetMediaType (const CString &strMediaType);
����������Sets the media type.

Constructor/Destructor Detail

CXmlWriter

CXmlWriter();

Constructs the XML writer.

~CXmlWriter

virtual ~CXmlWriter();

Destroys the XML writer.

Function Detail

GetUri

virtual bool GetUri(CString &strUri) = 0;

Queries the target URI.

Parameters:
strUri - on return, the string representing the target URI, if defined
Returns:
true if the target URI is defined; false otherwise

GetNamespaces

virtual bool GetNamespaces(bool &bNamespaces) = 0;

Queries the namespace processing indicator.

Parameters:
bNamespaces - on return, the boolean namespace processing indicator, if defined
Returns:
true if the namespace processing indicator is defined; false otherwise

GetMethod

virtual bool GetMethod(
    CString &strNamespaceUri, 
    CString &strLocalName) = 0;

Queries the name of the output method.

Parameters:
strNamespaceUri - on return, the output method namespace URI, if defined
strLocalName - on return, the output method local name, if defined
Returns:
true if the name of the output method is defined; false otherwise

GetVersion

virtual bool GetVersion(CString &strVersion) = 0;

Queries the version of the output method.

Parameters:
strVersion - on return, the version of the output method, if defined
Returns:
true if the version of the output method is defined, false otherwise

GetEncoding

virtual bool GetEncoding(CString &strEncoding) = 0;

Queries the preferred character encoding.

Parameters:
strEncoding - on return, the string representing the encoding name, if defined
Returns:
true if the encoding name is defined; false otherwise

GetOmitXmlDeclaration

virtual bool GetOmitXmlDeclaration(
    bool &bOmitXmlDeclaration) = 0;

Queries the omit XML declaration indicator.

Parameters:
bOmitXmlDeclaration - on return, the boolean XML declaration indicator, if defined
Returns:
true if the omit XML declaration indicator is defined; false otherwise

GetStandalone

virtual bool GetStandalone(bool &bStandalone) = 0;

Queries the standalone indicator.

Parameters:
bStandalone - on return, the boolean standalone indicator, if defined
Returns:
true if the standalone indicator is defined; false otherwise

GetDoctypePublic

virtual bool GetDoctypePublic(CString &strDoctypePublic) = 0;

Queries the document type system identifier.

Parameters:
strDoctypePublic - on return, the string representing the document type system identifier, if defined
Returns:
true if the document system identifier is defined; false otherwise

GetDoctypeSystem

virtual bool GetDoctypeSystem(CString &strDoctypeSystem) = 0;

Queries the document type public identifier.

Parameters:
strDoctypeSystem - on return, the string representing the document type public identifier, if defined
Returns:
true if the document system identifier is defined; false otherwise

GetIndent

virtual bool GetIndent(bool &bIndent) = 0;

Queries the indent indicator.

Parameters:
bIndent - on return, the boolean indent indicator, if defined
Returns:
true if the indent indicator is defined; false otherwise

GetMediaType

virtual bool GetMediaType(CString &strMediaType) = 0;

Queries the media type.

Parameters:
strMediaType - on return, the string representing the media type, if defined
Returns:
true if the media type is defined; false otherwise

SetUri

virtual void SetUri(const CString &strUri) = 0;

Sets the target URI.

Parameters:
strUri - the string representing the target URI

SetNamespaces

virtual void SetNamespaces(bool bNamespaces) = 0;

Sets the namepace processing indicator.

Parameters:
bNamespaces - the boolean namespace processing indicator

SetMethod

virtual void SetMethod(
    const CString &strNamespaceUri,
    const CString &strLocalName) = 0;

Sets the name of the output method.

Parameters:
strNamespaceUri - the output method namespace URI
strLocalName - the output method local name

SetVersion

virtual void SetVersion(const CString &strVersion) = 0;

Sets the version of the output method.

Parameters:
strVersion - the version of the output method

SetEncoding

virtual void SetEncoding(const CString &strEncoding) = 0;

Sets the preferred character encoding.

Parameters:
strEncoding - the string representing the encoding name

SetOmitXmlDeclaration

virtual void SetOmitXmlDeclaration(bool bOmitXmlDeclaration) = 0;

Sets the omit XML declaration indicator.

Parameters:
bOmitXmlDeclaration - the boolean omit XML declaration indicator

SetStandalone

virtual void SetStandalone(bool bStandalone) = 0;

Sets the standalone indicator.

Parameters:
bStandalone - the boolean standalone indicator

SetDoctypePublic

virtual void SetDoctypePublic(
    const CString &strDoctypePublic) = 0;

Sets the document type public identifier.

Parameters:
strDoctypePublic - the string representing the document type public identifier

SetDoctypeSystem

virtual void SetDoctypeSystem(
    const CString &strDoctypeSystem) = 0;

Sets the document type system identifier.

Parameters:
strDoctypeSystem - the string representing the document type system identifier

SetIndent

virtual void SetIndent(bool bIndent) = 0;

Sets the indent indicator.

Parameters:
bIndent - the boolean indent indicator

SetMediaType

virtual void SetMediaType(const CString &strMediaType) = 0;

Sets the media type.

Parameters:
strMediaType - the string representing the media type

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.