HI,
I' trying to transform a Document with XSLTProcessor::process.
Since a have a Dom document, I first map it to a XalanDocument and then use
that one to initialise my InputSource.
Everything works fine if I don't have an XML Declaration Node in my Dom
document but if I do, and of course I would like to have one, the
transformation doesn't work.
Although I'm using Xalan 1.1, I still need the XercesParserLiaison to do the
Xalan mapping, is there a better way to do this that would work with the
Declaration Node.
This is the code I use:
XercesDOMSupport theDOMSupport;
XercesParserLiaison theParserLiaison(theDOMSupport);
XSLTProcessorEnvSupportDefault theXSLTProcessorEnvSupport;
XObjectFactoryDefault theXObjectFactory;
XPathFactoryDefault theXPathFactory;
XSLTEngineImpl theProcessor(theParserLiaison, theXSLTProcessorEnvSupport,
theDOMSupport, theXObjectFactory,
theXPathFactory);
theXSLTProcessorEnvSupport.setProcessor(&theProcessor);
StylesheetConstructionContextDefault theConstructionContext(theProcessor,
theXSLTProcessorEnvSupport,
theXPathFactory);
StylesheetExecutionContextDefault
theExecutionContext(theProcessor,
theXSLTProcessorEnvSupport,
theDOMSupport,
theXObjectFactory);
XalanDocument *theDocXML =
theXercesParserLiaison.createDocument(xmlDoc);
XSLTInputSource theInputSource(theDocXML);
XalanDocument *theDocXSL =
theXercesParserLiaison.createDocument(xslDoc);
XSLTInputSource theStylesheetSource(theDocXSL);
XalanDocument *docOut = theXercesParserLiaison.createDocument();
XSLTResultTarget theResultTarget(docOut);
theProcessor.process(theInputSourceP, theStylesheetSource,
theResultTarget, theConstructionContext,
theExecutionContext);
DOM_Document domOut = theXercesParserLiaison.mapXercesDocument(docOut);
Thanks
Patrick
_____________________________
COGNICASE
Patrick Bronsard
Immeuble les Saisons
4 Place des Saisons - La d�fense 1
F-92036 Paris la D�fense Cedex
t�l : +33 (1) 41 02 34 80
E-mail <mailto:[EMAIL PROTECTED]>
www : www.cognicase.fr <http://www.cognicase.fr/>
_____________________________