xsl-list
[Top] [All Lists]

[xsl] Required item type of first operand of '/' is node(); supplied value has item type xs:string

2010-04-23 08:09:03
Good day,

I have found a million references to this problem on the Internet, but
I still can't get my template to work. People are typically
experiencing these issues in functions and parameter passing. My
application is very simple, but the solution keeps avoiding me.

I'm trying to use an element name as part of a path to a central
dictionary for my problem domain's terms. I'm keeping the vocabulary
under a different namespace so that I can move it out later.

The following template:
    <xsl:template match="c:*">
        <xsl:variable name="name" select="local-name()"/>
        <xsl:apply-templates
select="//c:smart-lookup-list/$name/description/node()"/>
     </xsl:template>

Is not working and gives the error described above.

If I hardcode a value (lets say 'monkey') then off course it works:
    <xsl:template match="c:*">
        <xsl:variable name="name" select="local-name()"/>
        <xsl:apply-templates
select="//c:smart-lookup-list/monkey/description/node()"/>
     </xsl:template>

I'll be grateful for any guidance.

Kind regards,
Jacobus

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--