Scott et al --
I need to retrofit my fix for Bug 1830 into the DTM version of XalanJ.
However, this will require a change to DTMManager and DTMManagerDefault
so I wanted to check in with you and let you know what I'm doing and see
if you think its okay or have an idea for another approach.
The problem reported in this bug is that EntityResolvers set in the
primary XMLReader are not propagated through to subsequent XMLReaders.
For example, when the document() function is used, an XMLReader is
created automatically in DTMManagerDefault.getXMLReader() but the
EntityResolver is not propagated into the automatically created reader.
In order to propagate the EntityResolver, I need to get the existing
EntityResolver from the primary reader at the time that the new
XMLReader is created. This is contained in the XPathContext but no
context is currently available to the DTMManager, even though the
DTMManager is created by the XPathContext and nowhere else. So, my idea
is to add a field to the DTMManager for the creating XPath instance.
Then, when the new XMLReader is created, the DTMManager implementation
can call back to the XPathContext to get the primary reader and then get
its EntityResolver and set that into the newly created reader.
I don't really see another way to do it but I was interested in your
thoughts. I hate to add a reference in the DTMManager to its creating
XPathContext but I didn't think I had a choice.
Thoughts?
Gary