I have an XSL stylesheet (A) that imports another one (B). A overrides a template (t) in B, and invokes B’s template with apply-imports:
From A:
<xsl:template match="t">
<xsl:apply-imports/>
</xsl:template>
From B:
<xsl:template match="t">
<p><!-- Do something --></p>
</xsl:template>
I now want A to add an attribute to the fragment (<p>…</p>) returned by apply-imports. The attribute should be added to element p directly, p should not be wrapped in another element. How can I do this?
Regards,
Jochen
IMHO, you can’t.
B is self-contained, when its matching template finishes running then
<p>is already constructed in the result tree and inaccessible to A.