I want to invoke error function in xslt 2.0 on a specific condition but i don't know the syntax to do this .
Please explain with an example.
Please check this code in the XSLT :
<xsl:if test="string-length(normalize-space($vehicle/VIN)) != 17"> error(QName('Invalid VIN')) </xsl:if>
Use e.g. <xsl:sequence select="if (string-length(normalize-space($vehicle/VIN)) != 17) then error(QName('http://example.com/', 'some-error-code'), 'Invalid VIN') else ()"/>.
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