How do we report XSLT error messages in Altova XMLSpy?
The XSLT tag <xsl:message terminate="yes">
is supposed to report a message upon specified condition.
However, Altova XMLSpy does not seem to report any messages&m开发者_Go百科dash;it's as though the tag is simply ignored.
How do we get error reporting to work in Altova XMLSpy?
Depending on specifically what it is you're doing, you might be able to use an XSD to validate your input prior to applying an XSLT to it, and having the XSD report errors as validation errors.
Or, alternatively you could design a 'pre-process' XSLT that identifies and outputs errors rather than the output you're looking for, and run that first. You could probably doing that by removing any output from your existing XSLT, and substituting <xsl:message>
with <xsl:text>
. To be honest though, that seems a bit of a 'hacky' way of doing it.
Or a final possibility is simply defining and outputting an <error>
element in your output, and doing a quick check for the presence of any such elements in your output, using a simple XPath query (//error
for example).
精彩评论