[jdom-interest] Off-topic question: XSL problem.

Simon simonjgauld at yahoo.com
Fri Jun 8 09:22:54 PDT 2001


XSL Question; not JDOM at all (Sorry for the
off-topic-ness of this one)

.. having scanned newsgroups / mailing list archives /
the w3.org spec. / and my trusty XSLT reference book,
I'm still having a problem.  Here's the XSL, snipped
out to look kinda ugly, but I hope you get the gist:

------------------

<xsl:template name="sometemplate">

<xsl:variable name="passedLocation">
/doc/products/product
</xsl:variable>

  <xsl:call-template name="someothertemplate">
    <xsl:with-param
name="passedLocation"><xsl:value-of
select="$passedLocation"/></xsl:with-param>
  </xsl:call-template>

</xsl:template>

<xsl:template name="someothertemplate">
  <xsl:param name="passedLocation"/>

  <xsl:for-each select="$passedLocation">
    Product name=<xsl:value-of select="name"/>
  </xsl:for-each>
</xsl:template>


----------------

The passed value passedLocation should be available to
be used by the for-each instruction.  It can be
debugged out using the <xsl:value-of ...> instruction
to check that it has been passed; it has.  However,
using it in an xsl:for-each doesn't seem to work.

If I used the same passedLocation param in a for-each
using the following:

<xsl:for-each select="$passedLocation[type='1']"> -
then this works fine.  I'm using Xalan-J 2.1.0.

Any takers? - why isn't the passedLocation being
accepted as a valid nodeset?

thanks in advance, and sorry for the off-topicity


.simon

exception msg:

javax.xml.transform.TransformerException: Can not
convert #RTREEFRAG to a NodeList!
        at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1269)

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie



More information about the jdom-interest mailing list