The value of $parameter is not an XPath expression; it is the result of evaluating an XPath expression. It's evaluated at the point where it is passed to Saxon, not at the point where the parameter is referenced.

The main use of XPath expressions as parameters is for simple constant expressions such as 




If you want a parameter whose value is a string containing an XPath expression, supply it (and declare it) as a string, and evaluate it using saxon:evaluate() or xsl:evaluate.

Michael Kay

On 8 Apr 2014, at 16:20, Christian Schwaderer <> wrote:

Hi there,

I'm new to this list and maybe asking a beginner's question.

I use Saxon EE using oXygen XML Editor.
I try to use a parameter from the "Transformation scenario windows" (which is, I hope, equal to the Saxon command line options).
But it doesn't work.

This is my input:

<?xml version="1.0" encoding="UTF-8"?>

This is my xslt:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
    <xsl:param name="parameter"/>
    <xsl:template match="/">
            <xsl:for-each select="$parameter">
                    <xsl:value-of select="."/>

In the oXygen parameter window I set the following:
name        value            
parameter    //element     [x] evaluate as XPath

Expected output is:

I hoped Saxon would create from the input parameter //element an Xpath expression selecting all <element> elements. But that isn't the case. Instead I get the error message: "Cannot evaluate the XPath expression '//element' for parameter 'parameter'. Reason: Finding root of tree: the context item is absent"

I don't understand this: There is context node! It is the root element "/".

Is this an issue of oXygen or is it me misunderstanding the concept of parameters?

Thanks in advance!
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
saxon-help mailing list archived at