Hi there,

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

I use Saxon EE 9.5.1.3 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"?>
<root>
    <element>1</element>
    <element>2</element>
</root>

This is my xslt:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="xs"
    version="2.0">
   
    <xsl:param name="parameter"/>
   
    <xsl:template match="/">
       
        <output_root>
           
            <xsl:for-each select="$parameter">
                <output_element>
                    <xsl:value-of select="."/>
                </output_element>
            </xsl:for-each>
           
        </output_root>
       
    </xsl:template>
   
</xsl:stylesheet>

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

Expected output is:
<output_root>
 <output_element>1</output_element>
 <output_element>2</output_element>
</output_root>

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!