I am using Apache FOP to generate AFP and PDF. Ideally there will be a huge volumn of AFP and PDF created. I am using xsl:message in multiple places of the code.
I want to prioritise only a set of xsl:message so that i don't overload the log file in production by setting a debug level.
For example, if i set debug level as 2 , only the necessary logs are presented. But if i set debug level as 10 that all logs are presented. By logs i mean xsl:message.
How do i achieve this?
It's going to depend a bit on your XSLT processor. In the Java world you're generally either using Xalan (which is XSLT 1.0) or Saxon (which is XSLT 3.0), but you've tagged the question XSLT 2.0 so we're left guessing a bit.
One way to handle this is with
use-whenattributes:<xsl:message use-when="$debug-level gt 3">Gotcha!</xsl:message>However, using static parameters in
use-whenlike this is a 3.0 feature.