Project

Profile

Help

Support #4538

closed

Maps not being returned properly?

Added by Norman Tovey-Walsh over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2020-05-02
Due date:
% Done:

0%

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

Description

This is sufficiently strange that I will not be surprised if it is complete stupidity on my part, but if it is, I can't see it.

Create a simple document:

<doc><?db style="background-color: red;"?></doc>

Process it with the attached stylesheet:

PIs:  1
Text: style="background-color: red;"
style background-color: red;
Text:
map:map{"style":"background-color: red;"}
pimap:map{"style":"background-color: red;"}
Error XTTE0780 while evaluating xsl:message at line 24 of file:/Users/ndw/Projects/docbook/tng/test.xsl: An empty sequence is not allowed as the result of a call to fp:pi-attributes#2

I can not see how that function is ever returning an empty sequence.

Also, but unrelated, if you stick this in a stylesheet:

  <xsl:variable name="dummy" as="element()">
    <doc><?db style="background-color: red;"?></doc>
  </xsl:variable>

  <xsl:message select="('Aside: is it a bug or feature that count($dummy/node())=',
                        count($dummy/node()))"/>

it will print the message:

Aside: is it a bug or feature that count($dummy/node())= 0

Files

test.xsl (3.05 KB) test.xsl Norman Tovey-Walsh, 2020-05-02 11:12
test2.xsl (3.44 KB) test2.xsl Norman Tovey-Walsh, 2020-05-02 14:44

Please register to edit this issue

Also available in: Atom PDF