Bug #5443
closedMissing namespace prefix in error message
0%
Description
Hi, folks!
In my stylesheets I have the following code, focusing on the assignment of the element "$c:f/c:missing" to a variable:
<xsl:template name="c:MainFrontCoverContent">
<xsl:param name="c:f" as="document-node()+" tunnel="yes"/>
<wrapper x:h="div*cover-page">
<!--FRONT COVER PAGE(S)-->
<!--Set colour palette to use-->
<xsl:variable name="c:colourBase" as="element()" select="
if ($c:isDraft) then
$c:coversInDraft
else
if ($c:inColour) then
$c:f/c:missing
else
$c:coversInBW"/>
<!--Top background with photo/image if applicable. The same
photo/image can be used on front and back covers or a separate
photo/image can be used for each cover according to the name.-->
<block-container absolute-position="fixed" left="10mm" right="10mm" top="10mm"
bottom="175mm" margin="0mm" padding="0mm"
background-color="{$c:colourBase/@c:topBackground}" z-index="0">
.....
In the expected error message (because the element "c:missing" is missing as a child of the variable $c:f), you can see that instead of reporting "$c:f/c:missing" the report reads "$c:f/missing". The namespace prefix of the child is not there:
[echo] Type error evaluating (docOrder($c:f/missing)) in xsl:variable/@select on line 204 column 30 of NORSOKcover.xsl:
[echo] XTTE0570: An empty sequence is not allowed as the value of variable $c:colourBase
[echo] at template c:MainFrontCoverContent on line 191 of NORSOKcover.xsl:
[echo] invoked by xsl:call-template at file:/Users/admin/u/git/render/render/SD/SDpage.xsl#269
[echo] In template rule with match="std-meta[("SD",...) = c:metaOriginator(...)][parent::front]" on line 237 of SDpage.xsl
[echo] invoked by xsl:apply-templates at file:/Users/admin/u/git/render/render/support/Realta-sts2fo-a4-base.xsl#495
[echo] at template c:doAdoptionStandardLayer on line 475 of Realta-sts2fo-a4-base.xsl:
[echo] invoked by xsl:call-template at file:/Users/admin/u/git/render/render/support/Realta-sts2fo-a4-base.xsl#423
[echo] In template rule with match="standard" on line 419 of Realta-sts2fo-a4-base.xsl
[echo] invoked by xsl:next-match at file:/Users/admin/u/git/render/render/support/Realta-sts2fo-a4-base.xsl#406
[echo] In template rule with match="standard" on line 405 of Realta-sts2fo-a4-base.xsl
[echo] invoked by xsl:next-match at file:/Users/admin/u/git/render/render/support/Realta-sts2fo-a4-base.xsl#388
[echo] In template rule with match="standard" on line 383 of Realta-sts2fo-a4-base.xsl
[echo] invoked by xsl:next-match at file:/Users/admin/u/git/render/render/support/force-sts.xsl#90
[echo] In template rule with match="*" on line 81 of force-sts.xsl
[echo] invoked by xsl:apply-templates at file:/Users/admin/u/git/render/render/support/Realta-sts2fo-a4-base.xsl#359
[echo] In template rule with match="/" on line 304 of Realta-sts2fo-a4-base.xsl
[echo] invoked by xsl:next-match at file:/Users/admin/u/git/render/render/support/Realta-sts2fo-a4-base.xsl#275
[echo] In template rule with match="/" on line 227 of Realta-sts2fo-a4-base.xsl
[echo] An empty sequence is not allowed as the value of variable $c:colourBase
In the attached I've attempted to replicate the error, because I cannot send you the 19 stylesheet fragments in the entire stylesheet tree.
Unfortunately, the error message does not read the same:
~/t/saxonica $ saxon9he -s:error-message.xsl -xsl:error-message.xsl
working
Type error at char 114 in xsl:variable/@select on line 60 column 30 of error-message.xsl:
XTTE0570: An empty sequence is not allowed as the value of variable $c:colourBase
at xsl:call-template name="c:MainFrontCoverContent" (file:/Users/admin/t/saxonica/error-message.xsl#28)
An empty sequence is not allowed as the value of variable $c:colourBase
~/t/saxonica $
Instead of:
Type error evaluating (docOrder($c:f/missing)) in xsl:variable/@select ...
I can get only:
Type error at char 114 in xsl:variable/@select ...
Perhaps you know how you can trigger the internal docOrder() function ... I'm not sure what part of my code in my production stylesheet does so.
Anyway, I found my problem, so the issue is of low priority ... but perhaps the fact that the reported argument to docOrder() isn't reported precisely correct might be something that needs looking into.
I hope this is helpful!
. . . . . Ken
Files
Please register to edit this issue