[EMAIL PROTECTED] wrote:
> Is there any possibility to implement this pattern in DocumentImpl
> in a future release of Xerces-J too? That would enable a subclass
> of DocumentImpl to produce subclasses of ElementImpl when its
If you're looking for a way to use DocumentImpl as a base and
provide your own version of ElementImpl, it's not too hard to
do. Here's a quick example:
import org.apache.xerces.dom.DocumentImpl;
import org.apache.xerces.dom.ElementImpl;
import org.w3c.dom.Element;
public class MyDocumentImpl extends DocumentImpl {
public Element createElement(String name) {
return new MyElementImpl(name);
}
public class MyElementImpl extends ElementImpl {
public MyElementImpl(String name) {
super(MyDocumentImpl.this, name);
}
}
}
It might be a little overkill to have methods for all of the
various node types in order to set them by name. And the
current DOM implementation would only be able to use node
objects that derive from our *Impl classes.
--
Andy Clark * IBM, JTC - Silicon Valley * [EMAIL PROTECTED]