Dave, you are right! The entity resolvers are not involved in the XalanTransformer use of XSLTInputStream create operations. The resolvers are bypassed and go directly to the local file system or the global Xerces::NetAccessor to create the input stream. This also appears to be the case for the XPath Document() function.
The Xerces::NetAccessor is global to the process and shared by all threads. The default NetAccessor is statically initialized by XMLPlatformUtils::Initialize(); A new globlal accessor can be registered after the Xerces static globals have been initialized, but this affects all use of the Xerces library for the process. The URL information is made available by the Xerces::XMLURL class as transmitted from Xalan to the Xerces library. Once an XMLReader takes over, then the entity resolvers are used. It may be worth some discussion to see whether entity resolver services should be used by Xalan before Xerces gets involved when creating the (Xalan::XSLTInputSource) input streams. - Steven J. Hathaway > On 10/14/2011 6:36 AM, ajay bhadauria wrote: >> Steve, >> Thanks a lot for time to explain. This helps a lot ! >> Regards >> Ajay > Note that the parser will not call the EntityResolver for the primary > document -- it will only call it for external parsed entities within the > primary document. This means you will not get a chance to resolve the > document specified in the document() function call. > > The way to make this work if for Xalan-C to implement something like > Xalan-J's URIResolver. If you'd like this feature, please create a Jira > issue. > > The general workaround for this is to write a small document to the file > system which uses an external entity with the actual document content. > > Dave > >