Re: system-properties(), was Re: p:xslt

"Dave Pawson" <> writes:

>>> I started this to get a string back from p:system-property()
>>> Do I have to run an xslt step to obtain this?
>>> I.e. to use xpath?
>> That dpeends, what do you want to do with the string?
> Initially just have a look at its parameters.
> Thought I'd try and output a system parameter as a way of using it.
> Due to the parameter malarky I'm having a great difficulty accessing it!

System properties and parameters are entirely unrelated, so I'm confused.

> E.g.
> In a pipeline
> <p:xslt name="trsf">
>   <p:input port='stylesheet'>
>     <p:document href="step1.xsl"/>
>   </p:input>
>   <p:input port='parameters' select=""/>
> </p:xslt>
> causes an npe from Saxon/calabash.

An NPE? Bug report that, please:

> But
> <p:xslt name="trsf">
>   <p:input port='stylesheet'>
>     <p:document href="step1.xsl"/>
>   </p:input>
> </p:xslt>
> Shows
> [dpawson@marge tests]$ -i source='step1.xml' step1.xpl
> Error
>   Cannot find a matching 1-argument function named
> {}system-property()

Have you tried to use p:system-property *inside* the XSLT stylesheet?
That won't work.

Try something like this:

<p:xslt name="trsf">
  <p:parameter name="product-name" select="p:system-property('p:product-name')"/>
  <p:input port="stylesheet">
    <xsl:stylesheet xmlns:xsl=""
      <xsl:param name="product-name"/>
      <xsl:template match="/">
        <doc><xsl:value-of select="$product-name"/></doc>

> I have both saxon9-s9api.jar and calabash in my classpath
> The stylesheet just uses xsl:value-of
> select="p:system-property('p:product-name')"

Yeah. You can't do that. The XProc extension functions aren't available
*inside steps* they're only available in the pipeline.

                                        Be seeing you,

Norman Walsh <> | The important thing is not what the            | author, or any artist, had in mind to
                              | begin with but at what point he decided
                              | to stop.--D. W. Harding

Received on Friday, 12 December 2008 16:38:07 UTC