Re: Using document() with a document containing xi:includes

On 4/17/18 3:13 PM, Imsieke, Gerrit, le-tex wrote:
> The default collection, collection(), is not defined if you invoke the 
> XSLT through Saxon. But in XSLT invoked through p:xslt, it’s the 
> sequence of the documents on the source port.
> 
> https://www.w3.org/TR/xslt20/#evaluation-context
> https://www.w3.org/TR/xproc/#c.xslt

The collection thing works, so now I'm just trying to expand my 
understanding. A friend wondered if you could pass the contents of a 
document from a port in as the value of a parameter. I've experimented 
with this adapting the example from 
https://gist.github.com/dwcramer/c65056fd3638e1cdcd052f4d05f2816e:

<p:with-param port="parameters" name="glossary" select="/*">
   <p:pipe port="result" step="xinclude-glossary"/>
</p:with-param>

But in that case <xsl:copy-of select="$glossary"/> in the xslt is just 
the text nodes from the xincluded glossary.

If I add as="node()" to the param declaration:
<xsl:param name="glossary" as="node()"/>

The pipeline fails with:

ERROR: Required item type of value of variable $glossary is node(); 
supplied value has item type xs:untypedAtomic

Is it possible to make the value of a param in xproc the contents of a 
result port? Or are parameter values in xproc limited to strings?

The spec says the name of a param has to be an xs:untypedAtomic, but I 
don't see it saying anything about the value:

https://www.w3.org/TR/xproc/#parameters

"[Definition: A parameter is a name/value pair where the name is an 
expanded name and the value must be a string or xs:untypedAtomic.]"

Regards,
David

Received on Wednesday, 18 April 2018 20:15:21 UTC