You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Brian Quinlan <br...@sweetapp.com> on 2002/04/20 01:22:20 UTC
EntityResolver
I'm exploring the use of a customer EntityResolver but I can't seem to
make it work. The complete code follows, but hopefully the following
snippet is sufficient:
MyResolver resolver;
XalanSourceTreeDOMSupport theDOMSupport;
XalanSourceTreeParserLiaison theParserLiaison(theDOMSupport);
theParserLiaison.setEntityResolver(&resolver); // XXX
// Hook the two together...
theDOMSupport.setParserLiaison(&theParserLiaison);
My resolveEntity method is never called.
Is there something that I'm missing here?
Cheers,
Brian
Complete code:
// Create some support objects that are necessary for running the
processor...
MyResolver resolver;
XalanSourceTreeDOMSupport theDOMSupport;
XalanSourceTreeParserLiaison theParserLiaison(theDOMSupport);
theParserLiaison.setEntityResolver(&resolver); // XXX
// Hook the two together...
theDOMSupport.setParserLiaison(&theParserLiaison);
// Create some more support objects...
XSLTProcessorEnvSupportDefault theXSLTProcessorEnvSupport;
XObjectFactoryDefault theXObjectFactory;
XPathFactoryDefault theXPathFactory;
// Create a processor...
XSLTEngineImpl theProcessor(
theParserLiaison,
theXSLTProcessorEnvSupport,
theDOMSupport,
theXObjectFactory,
theXPathFactory);
// Connect the processor to the support object...
theXSLTProcessorEnvSupport.setProcessor(&theProcessor);
// Create a stylesheet construction context, and a stylesheet
// execution context...
StylesheetConstructionContextDefault theConstructionContext(
theProcessor,
theXSLTProcessorEnvSupport,
theXPathFactory);
StylesheetExecutionContextDefault theExecutionContext(
theProcessor,
theXSLTProcessorEnvSupport,
theDOMSupport,
theXObjectFactory);
theProcessor.process(
*source,
*style,
*result,
theConstructionContext,
theExecutionContext);