FDO API Reference Feature Data Objects
Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FdoXmlCopyHandler Class Reference

#include <CopyHandler.h>

Inherits FdoDisposable, and FdoXmlSaxHandler.

Inheritance diagram for FdoXmlCopyHandler:

[legend]
List of all members.

Detailed Description

FdoXmlCopyHandler can be used to copy a set of elements from one XML document to another. It can be created and set as the SAX Handler for an XML Reader on the document to copy from. An XML Writer to the document to copy to is passed to one of the Create methods below. The elements to copy will be inserted at the XML writer's current position.

Definition at line 32 of file CopyHandler.h.


Static Public Member Functions

FDO_API_COMMON FdoXmlCopyHandlerCreate (FdoXmlWriter *writer, FdoString *uri, FdoString *name, FdoString *qName, FdoXmlAttributeCollection *atts, FdoDictionary *namespaces=NULL)
 Constructs a Copy Handler. When attached (as the SAX Handler) to a FdoXmlReader, this object copies the current element being parsed, plus all of its sub-elements.
FDO_API_COMMON FdoXmlCopyHandlerCreate (FdoXmlWriter *writer)
 Constructs a Copy Handler. When attached (as the SAX Handler) to a FdoXmlReader, this object copies all sub-elements of the current element being parsed.

Protected Member Functions

virtual FDO_API_COMMON FdoBoolean AttHasNs (FdoString *uri, FdoString *name, FdoString *qName, FdoXmlAttribute *att)
 This function is called before each attribute is copied to the destination document. It determines whether the attribute value references a qualified XML element name. If it does, then the namespace prefix for the value is converted to the equivalent prefix in the destination document.
FDO_API_COMMON FdoXmlCopyHandler (FdoXmlWriter *writer, FdoString *uri, FdoString *name, FdoString *qName, FdoXmlAttributeCollection *atts, FdoDictionary *namespaces=NULL)
FDO_API_COMMON FdoXmlCopyHandler (FdoXmlWriter *writer)
 
 FdoXmlCopyHandler ()
 DOXYGEN-IGNORE
FdoStringP HandleQAtt (FdoStringP uri, FdoStringP localName, FdoStringP prefix, FdoStringP QName)
void SetWriter (FdoXmlWriter *writer)
 DOXYGEN-IGNORE
void WriteNamespaces (FdoDictionary *namespaces)
 writes the given set of XML namespaces to the output document
void WriteStartElement (FdoString *uri, FdoString *name, FdoString *qName, FdoXmlAttributeCollection *atts)
virtual FDO_API_COMMON void XmlCharacters (FdoXmlSaxContext *, FdoString *)
 Default Sax callback that is called when the FdoXmlReader reads a chunk of simple content for the current element. Does nothing by default. This function may be called multiple times for the same element, if the the content is long. Applications must not make any assumptions about the chunk size or number of chunks for each element.
virtual FDO_API_COMMON FdoBoolean XmlEndElement (FdoXmlSaxContext *, FdoString *, FdoString *, FdoString *qName)
 Default Sax callback that is called when the FdoXmlReader reads the end tag for an XML element in the document. Does nothing.
virtual FDO_API_COMMON FdoXmlSaxHandlerXmlStartElement (FdoXmlSaxContext *, FdoString *, FdoString *name, FdoString *, FdoXmlAttributeCollection *)
 SAX handlers to catch and copy various XML fragments.
virtual FDO_API_COMMON ~FdoXmlCopyHandler ()

Constructor & Destructor Documentation

FdoXmlCopyHandler::FdoXmlCopyHandler  )  [inline, protected]
 

DOXYGEN-IGNORE

Definition at line 93 of file CopyHandler.h.

Referenced by Create().

FDO_API_COMMON FdoXmlCopyHandler::FdoXmlCopyHandler FdoXmlWriter writer  )  [protected]
 

FDO_API_COMMON FdoXmlCopyHandler::FdoXmlCopyHandler FdoXmlWriter writer,
FdoString uri,
FdoString name,
FdoString qName,
FdoXmlAttributeCollection atts,
FdoDictionary namespaces = NULL
[protected]
 

virtual FDO_API_COMMON FdoXmlCopyHandler::~FdoXmlCopyHandler  )  [protected, virtual]
 


Member Function Documentation

virtual FDO_API_COMMON FdoBoolean FdoXmlCopyHandler::AttHasNs FdoString uri,
FdoString name,
FdoString qName,
FdoXmlAttribute att
[protected, virtual]
 

This function is called before each attribute is copied to the destination document. It determines whether the attribute value references a qualified XML element name. If it does, then the namespace prefix for the value is converted to the equivalent prefix in the destination document.

Parameters:
uri Input the namespace URI for attribute's containing element.
name Input the local name for attribute's containing element.
qName Input the fully qualified name from attribute's containing element.
att Input the attribute to check.
Returns:
returns true if the attribute value is a qualified XML element name. This default implementation returns true only if the containing element is in the XML Schema namespace and the attribute name is one of ("base","type","ref"). Classes derived from FdoXmlCopyHandler can override this virtual function to change this behaviour.

FDO_API_COMMON FdoXmlCopyHandler* FdoXmlCopyHandler::Create FdoXmlWriter writer,
FdoString uri,
FdoString name,
FdoString qName,
FdoXmlAttributeCollection atts,
FdoDictionary namespaces = NULL
[inline, static]
 

Constructs a Copy Handler. When attached (as the SAX Handler) to a FdoXmlReader, this object copies the current element being parsed, plus all of its sub-elements.

Parameters:
writer Input the sub-elements are written to this XML writer.
uri Input current element's Universal Resource Indicator
name Input the unqualified name of the current element (doesn't include namespace)
qName Input the qualified name of the current element(includes namespace)
atts Input the attributes for the current element.
Warning:
If the current element will become the root element in the destination document, the caller is responsible for including all required xmlns: namespace declarations in the atts list.
Parameters:
namespaces Input list of XML namespace declarations to write to the destination document.
Returns:
Returns FdoXmlCopyHandler

Definition at line 79 of file CopyHandler.h.

References FDO_API_COMMON, and FdoXmlCopyHandler().

Here is the call graph for this function:

FDO_API_COMMON FdoXmlCopyHandler* FdoXmlCopyHandler::Create FdoXmlWriter writer  )  [inline, static]
 

Constructs a Copy Handler. When attached (as the SAX Handler) to a FdoXmlReader, this object copies all sub-elements of the current element being parsed.

Parameters:
writer Input the sub-elements are written to this XML writer.
Returns:
Returns FdoXmlCopyHandler

Definition at line 48 of file CopyHandler.h.

References FDO_API_COMMON, and FdoXmlCopyHandler().

Here is the call graph for this function:

FdoStringP FdoXmlCopyHandler::HandleQAtt FdoStringP  uri,
FdoStringP  localName,
FdoStringP  prefix,
FdoStringP  QName
[protected]
 

handles an attribute qualified by namespace. Adds namespace declaration to output document if not already there.

void FdoXmlCopyHandler::SetWriter FdoXmlWriter writer  )  [protected]
 

DOXYGEN-IGNORE

void FdoXmlCopyHandler::WriteNamespaces FdoDictionary namespaces  )  [protected]
 

writes the given set of XML namespaces to the output document

void FdoXmlCopyHandler::WriteStartElement FdoString uri,
FdoString name,
FdoString qName,
FdoXmlAttributeCollection atts
[protected]
 

General function for writing start of an element. Handles namespace translation, of the element name, between the source and destination documents.

virtual FDO_API_COMMON void FdoXmlCopyHandler::XmlCharacters FdoXmlSaxContext ,
FdoString
[protected, virtual]
 

Default Sax callback that is called when the FdoXmlReader reads a chunk of simple content for the current element. Does nothing by default. This function may be called multiple times for the same element, if the the content is long. Applications must not make any assumptions about the chunk size or number of chunks for each element.

Parameters:
saxContext Input caller specified contextual information
chars Input the next chunk of simple content

Reimplemented from FdoXmlSaxHandler.

virtual FDO_API_COMMON FdoBoolean FdoXmlCopyHandler::XmlEndElement FdoXmlSaxContext ,
FdoString ,
FdoString ,
FdoString qName
[protected, virtual]
 

Default Sax callback that is called when the FdoXmlReader reads the end tag for an XML element in the document. Does nothing.

Parameters:
saxContext Input caller specified contextual information
uri Input the element's Universal Resource Indicator
name Input the unqualified element name (doesn't include namespace)
qname Input the qualified element name (includes namespace)
Returns:
Returning true causes the current parse to stop. Returning false cause the parse to continue. Return value is ignored if the current parse is not an incremental parse ( see FdoXmlReader::Parse())

Reimplemented from FdoXmlSaxHandler.

virtual FDO_API_COMMON FdoXmlSaxHandler* FdoXmlCopyHandler::XmlStartElement FdoXmlSaxContext ,
FdoString ,
FdoString name,
FdoString ,
FdoXmlAttributeCollection
[protected, virtual]
 

SAX handlers to catch and copy various XML fragments.

Reimplemented from FdoXmlSaxHandler.


The documentation for this class was generated from the following file:
Comments or suggestions? Send us feedback.