[Bug 29458] New: [xslt30ts] seqtor-027

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29458

            Bug ID: 29458
           Summary: [xslt30ts] seqtor-027
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLT 3.0 Test Suite
          Assignee: abel.online@xs4all.nl
          Reporter: mike@saxonica.com
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

This is a tough one to analyze. I am getting a space before the "A". I think
it's simpler to work out what's happening if we simplify the test by writing
f:create(2) rather than f:create(61). In that case I get the result 

startend A BC

This follows the following logic, where CSC means "construct simple content",
and CCC is "construct complex content:

1. The initial template creates a text node "start" followed by the results of
f:create(2).

2. The result of f:create(2) is a text node whose string value is
CSC(f:create(1)) followed by the string "C"

3. The result of f:create(1) is a text node whose string value is
CSC(f:create(0)) followed by the string "B"

4. The result of f:create(0) is a text node whose string value is "end",
followed by the string "A".

So the overall result is equivalent to

let $R4 := (text("end"), "A")
let $R3 := (text(CSC($R4)), "B")
let $R2 := (text(CSC($R3)), "C")
let $R1 := (text("start"), $R2)
return $R1

Now:

CSC($R4) is as follows:

1. Zero-length text nodes in the sequence are discarded. No change.

2. Adjacent text nodes in the sequence are merged into a single text node. No
change.

3. The sequence is atomized (which may cause a dynamic error). => ("end", "A")

4. Every value in the atomized sequence is cast to a string. => ("end", "A")

5. The strings within the resulting sequence are concatenated, with a (possibly
zero-length) separator inserted between successive strings. => "end A"

6. In the case of xsl:processing-instruction, any leading spaces in the
resulting string are removed. N/A.

So $R3 is (text("end A"), "B")

CSC($R3), by similar logic to that above, is text("end A B")

So $R2 is (text("end A B"), "C")

So $R1 is (text("start"), text("end A B"), "C")

The final serialization step gives a result of

document-node(CCC(text("start"), text("end A B"), "C"))

Step 4 of CCC gives (text("start"), text("end A B"), text("C"))

Step 7 of CCC gives (text("startend A BC")

so the result is document-node("startend A BC")

which is the result that Saxon delivers.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Sunday, 14 February 2016 17:20:23 UTC