I have one simple question in xslt 2.0. Is there any way of obtaining the mode inside a template. I want to read the mode and compare with a value. This is because i require to use same template for different computations. There is a variable whose value is depending on mode.
Currently i am passing to solve this problem. If there is a way we can get the current mode of template, it will be useful.
No, XSLT 2.0 doesn't provide a function to find out the current mode name. You can however use e.g. <xsl:apply-templates mode="#current"/> to apply templates in the current mode.
If you want the mode as a name, then Saxon 9 provides it with an extension function http://saxonica.com/html/documentation/functions/saxon/current-mode-name.html.
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