|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CDomExtension { public: CDomExtension(const XGlobalObject &pGlobalObject); ~CDomExtension(); public: void Register( const CString &strPropertyName, const XDocumentFactory &pDocumentFactory, const XObject &pXmlObject); XObject GetDomObject(); static XDocument GetDocument(const XObject &pObject); public: static XObject CreateNode( const XObject &pDomObject, const XNode &pNode); public: static XNode GetNode(const XObject &pObject); static XNodeList GetNodeList(const XObject &pObject); static XNamedNodeMap GetNamedNodeMap(const XObject &pObject); };
The DOM extension package for the ECMAScript interpreter.
This class implements DOM extensions for ECMAScript interpreter as specified in Unicorn ECMAScript Interpreter Reference Manual. DOM Extensions Version 2.0.
Every object of this class must be associated with
an ECMAScript interpreter (an object of class
EcmaScript::CInterpreter
).
When a DOM extension package is constructed,
the global object of the associated ECMAScript interpreter
must be specified
as an argument of the constructor. Once the
CDomExtension
object is constructed,
its member function
Register
must be called in order to create
the initial set of DOM 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 DOM extensions.
CDocumentFactory, EcmaScript::CObject, EcmaScript::CGlobalObject, Dom::INode, Dom::INodeList, Dom::INamedNodeMap, Dom::IDocument
Constructor/Destructor Summary | |
CDomExtension
(const XGlobalObject &pGlobalObject);
����������Constructs the DOM extension package. |
|
~CDomExtension
();
����������Destroys the DOM extension package. |
Function Summary | |
void
|
Register
(const CString &strPropertyName, const XDocumentFactory &pDocumentFactory, const XObject &pXmlObject);
����������Registers this DOM extension package with the associated ECMAScript interpreter. |
XObject
|
GetDomObject
();
����������Returns the DOM extension root object. |
XDocument
|
GetDocument
(const XObject &pObject);
����������Returns a DOM document represented by the specified ECMAScript object. |
XObject
|
CreateNode
(const XObject &pDomObject, const XNode &pNode);
����������Creates a new ECMAScript object representing the specified DOM node. |
XNode
|
GetNode
(const XObject &pObject);
����������Returns a DOM node represented by the specified ECMAScript object. |
XNodeList
|
GetNodeList
(const XObject &pObject);
����������Returns a DOM node list represented by the specified ECMAScript object. |
XNamedNodeMap
|
GetNamedNodeMap
(const XObject &pObject);
����������Returns a DOM named node map represented by the specified ECMAScript object. |
Constructor/Destructor Detail |
CDomExtension(const XGlobalObject &pGlobalObject);
Constructs the DOM extension package.
pGlobalObject
- the ECMAScript global object.
The ECMAScript interpreter which owns the specified global object
will be associated with this DOM extension package.~CDomExtension();
Destroys the DOM extension package.
Function Detail |
void Register( const CString &strPropertyName, const XDocumentFactory &pDocumentFactory, const XObject &pXmlObject);
Registers this DOM extension package with the associated ECMAScript interpreter.
This function creates the initial set of DOM extension objects in the object space of the ECMAScript interpreter associated with this DOM extension package.
The XML extension
package (see
EcmaScriptXml::CXmlExtension
),
must be constructed and registered prior to
the registration of this DOM extension package.
The following information is required for the package registration:
"DOM"
;
however, an application programmer may choose another name,
if necessary.XML
property of the ECMAScript
global object, unless another property name was supplied
during the registration of XML extension package via
EcmaScriptXml::CXmlExtension::Register
.strPropertyName
- a string containing the name of
the global object property to be bound to the DOM extension root objectpDocumentFactory
- the document factory for generation
of new DOM documentspXmlObject
- the XML extension root objectXObject GetDomObject();
Returns the DOM extension root object.
static XDocument GetDocument(const XObject &pObject);
Returns a DOM document represented by the specified ECMAScript object.
The value of the internal
[[Class]
property
of the specified object must
be
"DOM.Document"
(that is, the specified object
must represent DOM document); otherwise the assertion error
will be signaled.
pObject
- the ECMAScript objectstatic XObject CreateNode( const XObject &pDomObject, const XNode &pNode);
Creates a new ECMAScript object representing the specified DOM node.
The internal
[[Class]]
property of
the newly created object will be set to
"DOM.Node"
,
regardless of the actual DOM node type.
pDomObject
- the DOM extension root objectpNode
- the DOM nodestatic XNode GetNode(const XObject &pObject);
Returns a DOM node represented by the specified ECMAScript object.
The value of the internal
[[Class]
property
of the specified object must
be one of
"DOM.Node"
,
"DOM.DocumentFragment"
,
"DOM.Document"
,
"DOM.CharacterData"
,
"DOM.Attr"
,
"DOM.Element"
,
"DOM.Text"
,
"DOM.Comment"
,
"DOM.CDATASection"
,
"DOM.EntityReference"
, or
"DOM.ProcessingInstruction
(that is, the specified object
must represent a DOM node); otherwise the assertion error
will be signaled.
pObject
- the ECMAScript objectstatic XNodeList GetNodeList(const XObject &pObject);
Returns a DOM node list represented by the specified ECMAScript object.
The value of the internal
[[Class]
property
of the specified object must be
"DOM.NodeList"
(that is, the specified object
must represent a DOM node list); otherwise the assertion error
will occur.
pObject
- the ECMAScript objectstatic XNamedNodeMap GetNamedNodeMap(const XObject &pObject);
Returns a DOM named node map represented by the specified ECMAScript object.
The value of the internal
[[Class]
property
of the specified object must be
"DOM.NamedNodeMap"
(that is, the specified object
must represent a DOM named node map); otherwise the assertion error
will be signaled.
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 |