Unicorn XML Toolkit
Version 1.00.00

Namespace SaxDom
Class CReader

class CReader: public Sax::CXmlStream {
public:
    CReader(const Dom::XNode &pNode);
    ~CReader();
public:
    void SetNode(const Dom::XNode &pNode);
    Dom::XNode GetNode();
    void SetNamespaces(bool bNamespaces);
    bool GetNamespaces();
public:
    void SetContentHandler(const Sax::XContentHandler &pHandler);
    Sax::XContentHandler GetContentHandler();
    void Start();
    };

The DOM reader.

This class provides implementation of XML stream that generates a sequence of SAX content events based on the content of a subtree of a DOM or XDM document.

An arbitrary DOM/XDM node can serve as a root of a subtree containing the source data. If the root node represents the DOM/XDM document, the content of the entire document will be transformed into a sequence of events. If the root node has any other type, the content of the subtree rooted at this node, including the node itself, will be transformed into a sequence of events. In any case, the generated sequence of events will be started with the StartDocument event and terminated with the EndDocument , even if the root node does not represent the entire document.

For each particular DOM reader, an application programmer can specify, whether this reader must perform SAX namespace processing.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
Sax::CContentHandler, Dom::INode
Constructor/Destructor Summary
CReader (const Dom::XNode &pNode);
����������Constructs the reader.
~CReader ();
����������Destroys the reader.

Function Summary
void SetNode (const Dom::XNode &pNode);
����������Sets the root node of a subtree containing the source data.
Dom::XNode GetNode ();
����������Returns the root node of a subtree containing the source data.
void SetNamespaces (bool bNamespaces);
����������Specifies whether the XML stream implemented by this reader must perform SAX namespace processing.
bool GetNamespaces ();
����������Tests whether the XML stream implemented by this reader must perform SAX namespace processing.
void SetContentHandler (const Sax::XContentHandler &pHandler);
����������Associates a SAX content handler with the XML stream implemented by this reader.
Sax::XContentHandler GetContentHandler ();
����������Returns a SAX content handler associated with the XML stream implemented by this reader.
void Start ();
����������Starts the XML stream implemented by this reader.

Constructor/Destructor Detail

CReader

CReader(const Dom::XNode &pNode);

Constructs the reader.

Parameters:
pNode - the root node of a subtree containing the source data

~CReader

~CReader();

Destroys the reader.

Function Detail

SetNode

void SetNode(const Dom::XNode &pNode);

Sets the root node of a subtree containing the source data.

This function cannot be called if the reader is started (that is, the member function Start was called and had not finish processing yet).

Parameters:
pNode - the root node of a subtree containing the source data

GetNode

Dom::XNode GetNode();

Returns the root node of a subtree containing the source data.

Returns:
the root node of a subtree containing the source data

SetNamespaces

void SetNamespaces(bool bNamespaces);

Specifies whether the XML stream implemented by this reader must perform SAX namespace processing.

Parameters:
bNamespaces - true if namespace processing is required; false otherwise

GetNamespaces

bool GetNamespaces();

Tests whether the XML stream implemented by this reader must perform SAX namespace processing.

Returns:
true if namespace processing is performed; false otherwise

SetContentHandler

void SetContentHandler(const Sax::XContentHandler &pHandler);

Associates a SAX content handler with the XML stream implemented by this reader.

Parameters:
pHandler - the SAX content handler

GetContentHandler

Sax::XContentHandler GetContentHandler();

Returns a SAX content handler associated with the XML stream implemented by this reader.

Returns:
the SAX content handler associated with the XML stream implemented by this reader; NULL if no content handler was specified

Start

void Start();

Starts the XML stream implemented by this reader.

When called, this function generates a sequence of SAX content events for the specified subtree, calling an approptiate member function of the associated content handler (if defined) for each event. It does not return until the entire sequence of events is produced (unless a fatal error is encountered).


Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

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