Project

Profile

Help

Same XSLT to process multiple documents

Added by Anonymous almost 18 years ago

Legacy ID: #3934541 Legacy Poster: Prasanna (pperera)

Hi, How can I use the same XSLT style sheet to process multiple source documents at the same time using the JAXP api? Thanks, Prasanna


Replies (3)

Please register to reply

RE: Same XSLT to process multiple documents - Added by Anonymous almost 18 years ago

Legacy ID: #3934560 Legacy Poster: Michael Kay (mhkay)

You create a single Templates object from the stylesheet, then you create two Transformer objects from it, which you can use in the same or different threads to transform different documents.

RE: Same XSLT to process multiple documents - Added by Anonymous almost 18 years ago

Legacy ID: #3934855 Legacy Poster: Prasanna (pperera)

Thanks Michael. But I want the style sheet to have access to the two source documents at the same time, so that the output from transforming the two source documents will go into the same output document. If I create two Transformer objects, then I can only transform one source document at a time.

RE: Same XSLT to process multiple documents - Added by Anonymous almost 18 years ago

Legacy ID: #3935051 Legacy Poster: Michael Kay (mhkay)

OK, thanks for the clarification. I assumed your requirement was more difficult than this. You can supply one document as the initial source document and read a second document using the document() function, or you can supply a second document as the value of a stylesheet parameter. Saxon accepts a JAXP Source object as the object passed to a parameter.

    (1-3/3)

    Please register to reply