Can I call another xslt template file that is reusable for/by other XSLT files. More like a common file/Helper xslt.( i am specifically using templates)
Use xs:include to bring in another stylesheet as a separate part of the one you're writing; use xs:import to bring in another stylesheet like or based on the one you're writing such that you'd like to override templates. For more details on xs:include vs xs:import , see: Combining Stylesheets with Include and Import.
By invoke, we mean that the named template is called and applied to the source document. If a template does not have a name, it cannot be called by this element. The xsl:template element is used to create a template. You can name a template by using the name attribute of the xsl:template element.
The <xsl:template> element is used to build templates. The match attribute is used to associate a template with an XML element. The match attribute can also be used to define a template for the entire XML document. The value of the match attribute is an XPath expression (i.e. match="/" defines the whole document).
With <xsl:apply-templates> the current node moves on with every iteration, whereas <xsl:call-template> does not change the current node. I.e. the . within a called template refers to the same node as the . in the calling template.
This is not XSLT 2.0 - specific question.
Both in XSLT 1.0 and XSLT 2.0 you can use the directives:
<xsl:import>
and
<xsl:include>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With