[gdome]How to make XPathNamespace derive from Node



In the new XPath module, there is a class, XPathNamespace, which 
represents namespaces returned by XPath queries.  According to the IDL 
definition*, XPathNamespace is a subclass of Node.

I'm writing the xpath.xml file for apigen and I would like to derive the 
Node's interface from core.xml for XPathNamespace.  What is the best
way of doing this?

1. Simple cut-and-paste

Paste the <INTERFACE NAME="Node" ... /> tags from core.xml into xpath.xml.
This would be easiest solution, but would be harder to maintain since
changes to the Node's interface would have to be made in two places.

2. Update apigen to allow cross-module inheritance

Currently apigen allows interfaces to be derived from each
other by making the interface element a sub-element of the parent interface
element.  We could extend apigen to allow interfaces to be derived from
other interfaces, even if they are not in the same XML file.  Or we could
put all the interface specifications into one file instead of separating
them into core.xml, event.xml, xpath.xml.

3. Place XPathNamespace class in core module

This would solve the problem by having the interface specification for
XPathNamespace be in core.xml, the same file where Node's interface is
specified.

Thanks,
-TJ

*http://www.w3.org/TR/2001/WD-DOM-Level-3-XPath-20011031/idl-definitions.html




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]