I have one XSLT file including other two xml files to generate html page, like below
<xsl:include href="xsltcache://UtilityTemplates.xml" />
<xsl:include href="xsltcache://eCertSpecificTemplates.xml" />
I do not know how to add multiple xsl sources (three files in this case) to transformer,
Source xslSource = new StreamSource(xslFile);
Transformer trasformToXml=tFactory.newTransformer(xslSource);
You are using a very specialized form of URI in the xsl:include directives, these look as if they were designed to be handled by custom URI dereferencing logic, perhaps an OASIS catalog.
The bog-standard way to do this would be to use relative URIs in the
xsl:include
(for example<xsl:include href="UtilityTemplates.xsl"/>
, to put all three files in the same directory, and then to make sure that the base URI of the main file is known (which it will be ifxslFile
is aFile
object).If there's some special magic to the "xsltcache" URIs then you need to find out what it is. But if you don't want to change the source, you can set a
URIResolver
on theTransformerFactory
. TheURIResolver
will be called when anxsl:include
declaration is encountered, and it can do anything it likes to convert the supplied URI to aSource
object containing the included module.