Bug #5950
closedEntityResolverWrappingResourceResolver is too demanding
100%
Description
The EntityResolverWrappingResourceResolver
only succeeds if the underlying resource resolver that it's wrapping returns a StreamSource
. The built in CatalogResourceResolver
does this, it takes the result that it gets back from the underlying catalog resolver and wraps it in a stream source.
However, it's possible (I haven't constructed a test case to demonstrate this yet), to configure the parser so that it's using a different resource resolver, for example, org.apache.xerces.util.EntityResolver2Wrapper
. That returns a standard SAX source and EntityResolverWrappingResourceResolver
fails.
I expect the answer is to be more accepting in the wrapper and turn the standard sorts of sources that can be returned into StreamSource
s in the wrapper. But it'll be easier to determine that after I've manged to construct a test case.
Updated by Norm Tovey-Walsh about 1 year ago
I've constructed a test case. If the resolver returns a SAXSource
, which seems highly likely, then simply adding
if (resolved instanceof SAXSource) {
return ((SAXSource) resolved).getInputSource();
}
is an obvious and low-risk fix. If the source returned is something else, it's less clear.
In principle, I suppose one could construct an InputSource
from a StAXSource
or a DOMSource
, but it's not clear it would be worth the effort.
Updated by Norm Tovey-Walsh about 1 year ago
- Status changed from New to Resolved
- Fix Committed on Branch 11, 12, trunk added
I've committed the fix that makes SAXSource
succeed. I don't think it's practical to attempt to support StAXSource
or DOMSource
, but I also think those are very unlikely in practice.
Updated by O'Neil Delpratt about 1 year ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.2 added
Bug fix applied in the Saxon 12.2 maintenance release.
Updated by Debbie Lockett 8 months ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 11.6 added
Bug fix applied in the Saxon 11.6 maintenance release.
Please register to edit this issue