Hello All,

Sorry for the previouse mail , i send it before finishing to describe the complete behavior !

I am trying to evaluate an XPath but it fails when this xpath expression is contained into a variable.
In my attached example, the output "result 1" works fine, but i cannot make run result 2, result 3 and result 4.
I get the error message:  -->   Xpath syntax error

Do you have any idea how should i proceed ?

here is my code
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/" exclude-result-prefixes="saxon">

<xsl:variable name="IoHwAbstractionFileName" select="'../xml/IoHwAbstraction.xml'"/>
<xsl:variable name="IoHwAbstraction" select="document($IoHwAbstractionFileName)"/>


<xsl:template match="/">
<xsl:variable name="xpath" select="/AUTOSAR/IoHwAbstraction/IoHwAbEcuSignals[2]/IoHwAbDiscreteOutput[1]/../../ShortName"/>

result 1 ok : <xsl:value-of select="$IoHwAbstraction/AUTOSAR/IoHwAbstraction/IoHwAbEcuSignals[2]/IoHwAbDiscreteOutput[1]/../../ShortName"/>

result 2 : <xsl:value-of  select="$IoHwAbstraction/$xpath]"/>

result 3 : <xsl:value-of  select="saxon:evaluate(concat($IoHwAbstraction,'$xpath'))"/>

result 4 : <xsl:value-of  select="saxon:evaluate(concat($IoHwAbstraction,'/AUTOSAR/IoHwAbstraction/IoHwAbEcuSignals[2]/IoHwAbDiscreteOutput[1]/../../ShortName'))"/>

</xsl:template>
</xsl:styleshee

Thank you for your support
Philippe