Closed DetachHead closed 3 months ago
Hey there,
Good question! Atomization is responsible for this behaviour: https://www.w3.org/TR/xpath-31/#id-atomization.
Step by step, this happens:
xs:string?
as the first argument (https://www.w3.org/TR/xpath-functions-31/#func-starts-with)This is described in the spec here: https://www.w3.org/TR/xpath-31/#dt-function-conversion.
You will need to string-join here, or to reproduce the XPath 1.0 compatibility mode: starts-with(//text => head(), 'abc')
In XPath 1.0 this works, like you observed. Technically you can reproduce this behaviour in XPath 3.1 with the use of the XPath 1.0 compatibility mode. This is not implemented and to be honest, I have no plans implementing this...
Kind regards,
Martin
thanks for the explanation
No problem, my pleasure!
On Thu, 1 Aug 2024 at 08:42, DetachHead @.***> wrote:
thanks for the explanation
— Reply to this email directly, view it on GitHub https://github.com/FontoXML/fontoxpath/issues/645#issuecomment-2262171832, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGKEJCXRU6XOURKWOKIELTZPHKE3AVCNFSM6AAAAABLZQM7HCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRSGE3TCOBTGI . You are receiving this because you commented.Message ID: @.***>
the following xpath works in both chrome and firefox's xpath 1 implementation, but fails in fontoxpath:
playground