Open ppalaga opened 1 year ago
I'm not very sure what is inlining
? are you suggesting to expand the include files ?
I'm not very sure what is
inlining
? are you suggesting to expand the include files ?
Yes, if there is <xsl:include href="my-include.xsl">
and if the content of my-include.xsl
is
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0'>
<xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
<xsl:template match="/">
<classpath-xsl subject="{/mail/subject}">
<cheese>
<xsl:apply-templates select="*|@*"/>
</cheese>
</classpath-xsl>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="attribute::*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
then the <xsl:include>
element would be replaced by something like
<xsl:template match="/">
<classpath-xsl subject="{/mail/subject}">
<cheese>
<xsl:apply-templates select="*|@*"/>
</cheese>
</classpath-xsl>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="attribute::*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
Not sure myself how well this can work. At least line refs in error messages will be skewed.
An idea: We could maybe support XSLT includes in native mode by inlining them before passing to the build time XSLT compiler.
There is a test that is disabled in native mode right now
https://github.com/apache/camel-quarkus/blob/029a620733a9e5a8c1cd3aa34a3d6fd43ba5b9dd/integration-test-groups/xml/native/xslt-classpath/src/test/java/org/apache/camel/quarkus/component/xml/it/XsltTest.java#L142-L154