Page 1 of 1

XPath 4.0

Posted: Thu Feb 08, 2024 5:47 pm
by Oleksii
Dear developers,

According to the feature release noted in [this link](https://www.componentsource.com/de/news ... enterprise), the XPath 4.0 syntax extensions are now fully supported.

However, when attempting to utilize the following variable, I encountered an error:

```xml
<variable as="map(*)" name="databaseData" select="let $key := $placeholderJson?API return $databaseDataWorkMovement?$key"> </variable>
```

The error message states: "The XPath parser is not configured to allow the use of XPath 4.0 syntax."

I have reviewed the documentation and preferences but have not found a way to configure the parser. The documentation I referred to is available at [this link](https://www.oxygenxml.com/doc/versions/ ... xpath.html).

<oXygen/> XML Editor 26.0, build 2024012406, Windows 10.

Kind regards,
Oleksii Sapov-Erlinger

Re: XPath 4.0

Posted: Fri Feb 16, 2024 10:17 am
by tavy
Hello Oleksii,

Unfortunately I cannot reproduce the issue that you describe. It would be helpful if you could provide us with a more comprehensive example to better understand the issue. In my testing, I utilized the provided XSLT sample and the validation process worked.

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="4.0">
    <xsl:variable name="placeholderJson" as="item()*"/>
    <xsl:variable name="databaseDataWorkMovement" as="item()*"/>
    <xsl:variable as="map(*)" name="databaseData" select="let $key := $placeholderJson?API return $databaseDataWorkMovement?$key"> </xsl:variable>
</xsl:stylesheet>
Best Regards,
Octavian

Re: XPath 4.0

Posted: Wed Apr 17, 2024 11:45 am
by Oleksii
The problem with the expression above was indeed some syntax failure.
However, now I want to use an new XPath function and oXygen does not recognize it.

For testing purpose I use an example from here (https://qt4cg.org/specifications/xpath- ... ndex-where)

Code: Select all

<xsl:variable name="a" select="array:index-where([ 0, (), 4, 9 ], boolean#1)"/>
Getting in oXygen (26.1)
Cannot find a 2-argument function named Q{http://www.w3.org/2005/xpath-functions/ ... ex-where()
.
BTW: The documentation link points to the https://www.w3.org/2005[/ ...

Re: XPath 4.0

Posted: Mon Apr 22, 2024 10:02 am
by tavy
Hi Oleksii,
Unfortunately I cannot reproduce this issue either. If I use the "array:index-where()" function in an XSLT sample, both the validation and transformation processes were successful. I tested with <oXygen/> XML Editor 26.1, build 2024031806.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:array="http://www.w3.org/2005/xpath-functions/array" exclude-result-prefixes="array"
    version="2.0">
    <xsl:variable name="a" select="array:index-where([0, (), 4, 9], boolean#1)"/>
    <xsl:template name="test"><xsl:value-of select="$a"/></xsl:template>
</xsl:stylesheet>
Best Regards,
Octavian