Link to XSL stylesheet in another

I have an XSL stylesheet that I want to compile in dll using the xsltc.exe command. The problem I ran into is that there is a regular stylesheet that is used, and my stylesheet references this stylesheet using the xsl: include tag, as shown below:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:include href ="../objectTemplates.xslt"/></xsl:stylesheet>

Is it possible to compile the stylesheet into another dll and use it to compile.

So, if I compiled the original stylesheet in "SomeStylesheet.dll" and the reference stylesheet in "ObjectTemplate.dll"

Do I need to duplicate the code for the objectTemplates.xslt file in the first XSLT file and remove the xsl: include link or can I still have separate xsl files for them and still use the compiled XSLT files.

Any pointers would be really helpful.

+3
source share
1 answer

As of the date this answer was written, XSLT (1.0, 2.0 and avilable first working draft 2.1) , as defined in the corresponding W3C specifications, is not able to use objects (style sheets, global variables, ..., etc.) from an external compiled table styles.

That is, if a given XSLT processor can compile a style sheet, this style sheet can only be executed as the main style sheet, and its compiled form cannot be used imported / included by other style sheets that are not compiled in the same compiled module.

, , .

+1

Source: https://habr.com/ru/post/1753090/


All Articles