|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CXmlExtension { public: CXmlExtension(const XGlobalObject &pGlobalObject); ~CXmlExtension(); public: void Register( const CString &strPropertyName, const XReaderFactory &pReaderFactory, const XWriterFactory &pWriterFactory); XObject GetXmlObject(); public: static XObject CreateContentHandler( const XObject &pXmlObject, const Sax::XContentHandler &pContentHandler); static XObject CreateStream( const XObject &pXmlObject, const Sax::XXmlStream &pStream); static XObject CreateProcessor( const XObject &pXmlObject, const Sax::XXmlProcessor &pProcessor); public: static Sax::XContentHandler GetContentHandler(const XObject &pObject); static Sax::XXmlStream GetStream(const XObject &pObject); static Sax::XXmlProcessor GetProcessor(const XObject &pObject); public: static Sax::XContentHandler WrapContentHandler(const XObject &pObject); static Sax::XXmlStream WrapStream(const XObject &pObject); };
The XML extension package for the ECMAScript interpreter.
This class implements XML extensions for ECMAScript interpreter as specified in Unicorn ECMAScript Interpreter Reference Manual. XML Extensions Version 2.0.
Every object of this class must be associated with
an ECMAScript interpreter (an object of class
EcmaScript::CInterpreter
).
When an XML extension package is constructed,
the global object of the associated ECMAScript interpreter
must be specified
as an argument of the constructor. Once the
CXmlExtension
object is constructed,
its member function
Register
must be called in order to create
the initial set of XML extension objects in the object
space of the associated ECMAScript interpreter.
This class also provides few static functions supporting creation and type casting for ECMAScript objects implemented by XML extensions.
EcmaScript::CObject, EcmaScript::CGlobalObject, Sax::CContentHandler, Sax::CXmlStream, Sax::CXmlProcessor, Sax::CXmlReaderFactory, XmlWriter::CXmlWriterFactory
Constructor/Destructor Summary | |
CXmlExtension
(const XGlobalObject &pGlobalObject);
����������Constructs the XML extension package. |
|
~CXmlExtension
();
����������Destroys the XML extension package. |
Function Summary | |
void
|
Register
(const CString &strPropertyName, const XReaderFactory &pReaderFactory, const XWriterFactory &pWriterFactory);
����������Registers this XML extension package with the associated ECMAScript interpreter. |
XObject
|
GetXmlObject
();
����������Returns the XML extension root object. |
XObject
|
CreateContentHandler
(const XObject &pXmlObject, const Sax::XContentHandler &pContentHandler);
����������Creates a new ECMAScript object representing the specified SAX content handler. |
XObject
|
CreateStream
(const XObject &pXmlObject, const Sax::XXmlStream &pStream);
����������Creates a new ECMAScript object representing the specified XML stream. |
XObject
|
CreateProcessor
(const XObject &pXmlObject, const Sax::XXmlProcessor &pProcessor);
����������Creates a new ECMAScript object representing the specified XML processor. |
Sax::XContentHandler
|
GetContentHandler
(const XObject &pObject);
����������Returns a SAX content handler represented by the specified ECMAScript object. |
Sax::XXmlStream
|
GetStream
(const XObject &pObject);
����������Returns an XML stream represented by the specified ECMAScript object. |
Sax::XXmlProcessor
|
GetProcessor
(const XObject &pObject);
����������Returns an XML processor represented by the specified ECMAScript object. |
Sax::XContentHandler
|
WrapContentHandler
(const XObject &pObject);
����������Returns a SAX content handler, which wraps event processing ECMAScript function properties associated with the specified ECMAScript object. |
Sax::XXmlStream
|
WrapStream
(const XObject &pObject);
����������Returns an XML stream, which wraps event processing ECMAScript function properties associated with the specified ECMAScript object. |
Constructor/Destructor Detail |
CXmlExtension(const XGlobalObject &pGlobalObject);
Constructs the XML extension package.
pGlobalObject
- the ECMAScript global object.
The ECMAScript interpreter which owns the specified global object
will be associated with this XML extension package.~CXmlExtension();
Destroys the XML extension package.
Function Detail |
void Register( const CString &strPropertyName, const XReaderFactory &pReaderFactory, const XWriterFactory &pWriterFactory);
Registers this XML extension package with the associated ECMAScript interpreter.
This function creates the initial set of XML extension objects in the object space of the ECMAScript interpreter associated with this XML extension package.
The following information is required for the package registration:
"XML"
;
however, an application programmer may choose another name,
if necessary.XReaderFactory
used with the corresponding
argument of
Register
function is an
alias for the reference-counted pointer to
Sax::CXmlReaderFactory
.XWriterFactory
used with the corresponding
argument of
Register
function is an
alias for the reference-counted pointer to
XmlWriter::CXmlWriterFactory
.strPropertyName
- a string containing the name of
the global object property to be bound to the XML extension root objectpReaderFactory
- the reader factory for generation
of new XML readerspWriterFactory
- the writer factory for generation
of new XML writersXObject GetXmlObject();
Returns the XML extension root object.
static XObject CreateContentHandler( const XObject &pXmlObject, const Sax::XContentHandler &pContentHandler);
Creates a new ECMAScript object representing the specified SAX content handler.
The internal
[[Class]]
property of
the newly created object will be set to
"XML.ContentHandler"
.
pXmlObject
- the XML extension root objectpContentHandler
- the SAX content handlerstatic XObject CreateStream( const XObject &pXmlObject, const Sax::XXmlStream &pStream);
Creates a new ECMAScript object representing the specified XML stream.
The internal
[[Class]]
property of
the newly created object will be set to
"XML.Stream"
.
pXmlObject
- the XML extension root objectpStream
- the XML streamstatic XObject CreateProcessor( const XObject &pXmlObject, const Sax::XXmlProcessor &pProcessor);
Creates a new ECMAScript object representing the specified XML processor.
The internal
[[Class]]
property of
the newly created object will be set to
"XML.Processor"
.
pXmlObject
- the XML extension root objectpProcessor
- the XML processorstatic Sax::XContentHandler GetContentHandler(const XObject &pObject);
Returns a SAX content handler represented by the specified ECMAScript object.
The object must represent a SAX content handler (that is, the ContentHandler prototype must appear in the object's prototype chain).
pObject
- the ECMAScript objectstatic Sax::XXmlStream GetStream(const XObject &pObject);
Returns an XML stream represented by the specified ECMAScript object.
The object must represent an XML stream (that is, the Stream prototype must appear in the object's prototype chain).
pObject
- the ECMAScript objectstatic Sax::XXmlProcessor GetProcessor(const XObject &pObject);
Returns an XML processor represented by the specified ECMAScript object.
The object must represent an XML processor (that is, the Processor prototype must appear in the object's prototype chain).
pObject
- the ECMAScript objectstatic Sax::XContentHandler WrapContentHandler(const XObject &pObject);
Returns a SAX content handler, which wraps event processing ECMAScript function properties associated with the specified ECMAScript object.
The object must represent a SAX content handler (that is, its prototype chain must contain the ContentHandler prototype).
pObject
- the ECMAScript objectstatic Sax::XXmlStream WrapStream(const XObject &pObject);
Returns an XML stream, which wraps event processing ECMAScript function properties associated with the specified ECMAScript object.
The object must represent an XML stream (that is, its prototype chain must contain the Stream prototype).
pObject
- the ECMAScript object
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |