[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

In XSLT 3.0, should the "document" function be availab

Subject: In XSLT 3.0, should the "document" function be available in xsl:evaluate?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Jan 2017 14:35:34 -0000
 In XSLT 3.0
Both the latest internal draft of the XSLT 3.0 spec in https://www.w3.org/XML/Group/qtspecs/specifications/xslt-30/html/#dynamic-xpath as well as the official https://www.w3.org/TR/xslt-30/#element-evaluate say about the function signatures in the context of dynamic XPath evaluation using xsl:evaluate: "Note that this set deliberately excludes XSLT-defined functions in the standard function namespace".

Based on that I would expect the XSLT "document" function not to be available in dynamic XPath evaluation using xsl:evaluate. So I wrote a test case doing

<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"
exclude-result-prefixes="array fn map math xs">

<xsl:output method="xml"/>

<xsl:template name="main" match="/">
let $f := function-lookup(xs:QName('fn:document'), 1)
if (exists($f)) then
'not found'"/>
<xsl:variable name="path" as="xs:string">
let $f := function-lookup(xs:QName('fn:document'), 1)
if (exists($f)) then
'not found'</xsl:variable>
<xsl:evaluate xpath="$path"/>


and expected that to return the stylesheet code for the xsl:sequence and 'not found' for the xsl:evaluate.

However, only Exselt gives me that result, both Saxon 9.7 EE as well as Altova XMLSpy return the stylesheet code twice which seems to indicate they make the 'document' function available to xsl:evaluate. Isn't that a bug? Or does the spec need to allow it if an implementer wants to go beyond pure XPath support?

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.