[jdom-interest] SAXHandler's private Document member

Paul Chapman chapman at zemsys.com
Sun Aug 25 17:26:17 PDT 2002


I notice that in jdom-b8 you have made a lot of the internal data
of SAXHandler protected so that the class can be inherited from.

One exception is the Document data-member. Is there a good reason
for this, or just an oversight? I would like to request that it
too is available to subclasses as a protected member.

I have been using JDOM to merge multiple XML files into a single
Document. This means I am using the same SAXHandler (actually an
instance of my own class derived from SAXHandler) multiple times
to read different inputs. However, if I want to perform a second
merge, I must either:

   1. create a new handler to get a new document or
   2. create a new Document and then move across the root-elment
      from the one inside the handler (which is both ugly and
      obscure).

Could I request a new constructor and method:
    public SAXHandler( JDOMFactory f, Document d )
    public void setDocument( Document d )

If you prefer, just making document protected would be sufficient.

Regards, Paul.

-- 

Paul Chapman

Email:  chapman at zemsys.com
Mobile: +61 418 340 935




More information about the jdom-interest mailing list