"K. Ari Krupnikov" wrote:
> What is the recommended way to use Xerces parser to build a DOM tree in
> a different implementation?
> 
> I subclassed org.apache.xerces.parsers.DOMParser such that
> DEFAULT_DOCUMENT_CLASS_NAME is set to my Document implementation, and
> fDocument is set to an empty Document from my implementation. [1]
> 
> Is there a better way?

You don't need to subclass the parser itself; you only need to
set the appropriate property on the parser to set the new DOM
implementation by using the fully qualified class name. For
example:

 
domParser.setProperty("http://apache.org/xml/properties/dom/document-class-name";,
                        "andyc.MyDocumentImpl");

-- 
Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]

Reply via email to