You're passing a document node, which has no name. You need to pass the element node. I'd suggest declaring the variable as
 

<xsl:variable name=”param1” as="element()">

  <doc-uri>

  <xsl:value-of select=”some content goes here”/>

  </doc-uri>

</xsl:variable>

 

which will achieve this.

 

I've made a change to the code to stop this mistake happening in future. If you pass a document node, it will automatically go down to its element children.

 

Michael Kay

http://www.saxonica.com/



From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Vion-Dury, Jean-Yves
Sent: 15 June 2007 15:22
To: saxon-help@lists.sourceforge.net
Subject: [saxon] saxon:transform and parameter passing problem

Hi,

I’m trying to pass a parameter to a stylesheet using

 

> 

>saxon:transform(‘<some-compiled-target-xslt-script>’,$some-variable-containing-a-tree,($param1))

> 

 

As specified in the saxon8.9 documentation, $param1 should refer to a node which name must match the expected parameter, and which atomized content will specifies the value.

 

$param1 is constructed via

 

<xsl:variable name=”param1”>

  <doc-uri>

  <xsl:value-of select=”some content goes here”/>

  </doc-uri>

</xsl:variable>

 

 And the target stylesheet is waiting for a parameter “doc-uri”

 

<xsl:param name=”doc-uri” required=”true”/>

 

 

However, at run time, I get

 

Error

  XTDE0050: No value supplied for required parameter doc-uri

 

Many thanks for your help,

 

Jean-Yves

 

PS I’m using the 8.9B version

____________________

 

Jean-Yves Vion-Dury

Senior Scientist

 

Document Structure Area

 

Xerox Research Centre Europe,

6 chemin de Maupertuis

38240 Meylan - FRANCE

(+33)4 76 61 51 52