Project

Profile

Help

Feature #4961

open

use-when in SEF compilation phase

Added by Martynas Jusevicius about 3 years ago. Updated almost 2 years ago.

Status:
New
Priority:
High
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
2021-04-02
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

ac:uuid is my custom extension function which is obviously not available client-side. But using use-when as follows allowed me to differentiate between function calls on the server and in the browser:

<xsl:value-of use-when="system-property('xsl:product-name') eq 'Saxon-JS'" select="resolve-uri(concat('/', ixsl:call(ixsl:window(), 'generateUUID', [])), $ac:uri)"/>
<xsl:value-of use-when="system-property('xsl:product-name') = 'SAXON'" select="resolve-uri(concat('/', ac:uuid()), $ac:uri)"/>

That worked fine when compiling SEF with Saxon-JS. Now I'm trying Saxon-EE for that, and a different use-when kicks in and I get an error about the missing ac:uuid function:

Error near {...ve-uri(concat('/', ac:uuid(...} at char 24 in xsl:value-of/@select on line 460 column 175 of default.xsl:
  XPST0017  Cannot find a 0-argument function named Q{https://w3id.org/atomgraph/client#}uuid()
Error near {...ac:forClass, $ldt:base) els...} at char 24 in xsl:param/@select on line 230 column 161 of resource.xsl:
  XPST0017  Cannot find a 3-argument function named
  Q{https://w3id.org/atomgraph/client#}construct-doc()

Is there a workaround here? Can some property be used to differentiate between compilation and execution phases in use-when?

Please register to edit this issue

Also available in: Atom PDF Tracking page