Unexpected token [$] in path expression

Here should go questions about transforming XML with XSLT and FOP.
droomdp
Posts: 9
Joined: Fri Jan 30, 2009 6:57 pm

Unexpected token [$] in path expression

Post by droomdp »

Hi,

I'm merging 2 XML files
and get in some trouble.

How can I do the following ?

<!-- path to second XML: PC.xml -->
<xsl:param name="PCRef" select="'PC.xml'"/>
<!-- -->
...
<xsl:attribute name="ValueToGet">
<!-- get value out of first XML -->
<xsl:variable name="myPC" select="Element1/Element2"/>
<!-- get value out of second XML based of the variable 'myPC'-->
<xsl:value-of select="document($PCRef)/El1/$myPC/@pc"/>
</xsl:attribute>

the variable $myPC is not accepted in the path expression.
I get the error: Unexpected token [$] in path expression.

How can I add a variable elementname in a path expression ?

Kind Regards,

Droom
droomdp
Posts: 9
Joined: Fri Jan 30, 2009 6:57 pm

Re: Unexpected token [$] in path expression

Post by droomdp »

Hi,

Finaly I found the solution of my problem:

<xsl:value-of select="document($PCRef)//*[name(.)=$myGem]/@pc"/>


Regards,
Droom
Post Reply