XPath 4.0

Here should go questions about transforming XML with XSLT and FOP.
Oleksii
Posts: 84
Joined: Wed Jul 19, 2017 6:04 pm
Location: Austria
Contact:

XPath 4.0

Post 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
Kind regards,
Oleksii Sapov-Erlinger
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: XPath 4.0

Post 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
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Oleksii
Posts: 84
Joined: Wed Jul 19, 2017 6:04 pm
Location: Austria
Contact:

Re: XPath 4.0

Post 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[/ ...
Kind regards,
Oleksii Sapov-Erlinger
tavy
Posts: 365
Joined: Thu Jul 01, 2004 12:29 pm

Re: XPath 4.0

Post 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
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply