Reputation: 2918
I need to generate a runtime error in an xslt. How to do so?
The following xpaths do not generate runtime errors:
It does not have to be done using xpath, could be done using some xslt construct.
The reason I want this is to effectively have a "NotImplementedException" in my xslt. There is a specific path that will not be used any time soon, so I do not want to implement it yet.
Upvotes: 2
Views: 333
Reputation: 243449
In addidtion to <xsl:message>
in XSLT 2.x one can use the standard XPath 2.0 function error()
.
Upvotes: 3
Reputation: 60398
You can terminate an XSL script and deliver a message using the xsl:message
element.
<xsl:message terminate="yes">
NotImplementedException
</xsl:message>
Upvotes: 4