Re: Node identity in XProc 3

Am 08.07.2020 um 15:34 schrieb Achim Berndzen:
>
>> Am 08.07.2020 um 14:38 schrieb Norman Tovey-Walsh <ndw@nwalsh.com>:
>>
>> Martin Honnen <martin.honnen@gmx.de> writes:
>>> I am not sure whether that is supposed to be preserved when the array is
>>> the result of a p:xquery step.
>>>
>>> Thoughts?
>>
>> With the possible exception of p:identity (and maybe a couple of other
>> steps), node identity should not be expected.

> I completely agree with Norms analysis.
> If we would stipulate node identity say for the XQuery in question or an equivalent XSLT, this would result in a massive vendor lock: The node model used in the XProc implementation, as well as in p:xquery and p:xslt would need to be the same. Any conversion what so ever will al least threaten node identity, so no conversion could take place.


In Morgana's current implementation, based solely on the result of the
pipeline below, it seems node identity is preserved when Morgana's XProc
XDM is converted to Saxon's XDM for the p:xquery.

Why is that identity preservation not possible when propagating XDM
values from Saxon to Morgana?

Example is

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0"
     xmlns:c="http://www.w3.org/ns/xproc-step"
     xmlns:array="http://www.w3.org/2005/xpath-functions/array"
     exclude-inline-prefixes="#all">
     <p:input port="source">
         <root>
             <test>foo</test>
         </root>
     </p:input>
     <p:output port="result" sequence="true"/>
     <p:json-join>
         <p:with-input pipe="source source source source source"/>
     </p:json-join>
     <p:identity message="{every $doc1 in ?* satisfies every $doc2 in ?*
satisfies $doc1 is $doc2} {count(?*)}"/>
     <p:xquery>
         <p:with-input port="query">
             <c:query>. instance of array(document-node()), every $doc1
in ?* satisfies every $doc2 in ?* satisfies $doc1 is $doc2, count(?*),
count(?*/.)</c:query>
         </p:with-input>
     </p:xquery>
</p:declare-step>

and outputs

MorganaXProc-IIIse 0.9.3.7-beta
[snip]

true 5
Using Saxon-EE 10.0. XSLT and XQuery processor developed by Saxonica Limited
true

true

5

1


So despite a conversion, both in Morgana's XDM and Saxon's XDM there is
an array with five identical document nodes.

Received on Wednesday, 8 July 2020 16:51:52 UTC