Project

Profile

Help

Bug #5648

closed

SaxonCS with command line -ea:on triggers xs:assert but doesn't output the message inside

Added by Martin Honnen over 1 year ago. Updated over 1 year ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Command Line
Sprint/Milestone:
-
Start date:
2022-08-17
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
11
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
.NET

Description

Perhaps this is related to the existing problem with xsl:message of SaxonCS but I am not sure, I find that the content of a triggered xsl:assert in SaxonCS is not output, contrary to what SaxonJ does.

So

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="3.0"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="#all"
  expand-text="yes">

  <xsl:param name="input" as="xs:string" select="'abc'"/>

  <xsl:template match="/" name="xsl:initial-template">
    <xsl:comment>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</xsl:comment>
    <xsl:assert test="$input castable as xs:integer">{$input} should be an integer</xsl:assert>
    <int>{$input}</int>
  </xsl:template>

  <xsl:output indent="yes"/>
  
</xsl:stylesheet>

with options -it -ea:on -xsl:.\assert-test1.xsl with CS gives only

Error at xsl:assert on line 12 column 6 of assert-test1.xsl:
  XTMM9001  Processing terminated by xsl:assert at line 12 in assert-test1.xsl
at template xsl:initial-template on line 10 column 4 of assert-test1.xsl:
Processing terminated by xsl:assert at line 12 in assert-test1.xsl
Exiting with code 2

while SaxonJ outputs

abc should be an integer
Error at xsl:assert on line 12 column 54 of assert-test1.xsl:
  XTMM9001  Processing terminated by xsl:assert at line 12 in assert-test1.xsl
at template xsl:initial-template on line 10 column 55 of assert-test1.xsl:
Processing terminated by xsl:assert at line 12 in assert-test1.xsl

Tested with 11.4 under Windows.


Related issues

Is duplicate of Saxon - Bug #5553: SaxonCS - when running from command line, xsl:message output goes nowhereClosedMichael Kay2022-05-31

Actions
Actions #1

Updated by Michael Kay over 1 year ago

Yes, this is almost certainly the same as the xsl:message problem; the two instructions use the same code path internally.

Actions #2

Updated by Michael Kay over 1 year ago

  • Is duplicate of Bug #5553: SaxonCS - when running from command line, xsl:message output goes nowhere added
Actions #3

Updated by Michael Kay over 1 year ago

  • Status changed from New to Duplicate

Please register to edit this issue

Also available in: Atom PDF