Hello!
I'm trying to create my Xpath in a variable and give to the copy-of function. The problem is the xml result. The xpath is not execute by the copy-of function, the xpath is displayed on the screen! What's i'm doing wrong???
I'm doing it because my xpath is normally in another xml file.
This is the xsl code
Thanks!
<xsl:template match="/" >
<xsl:variable name="sValue">Purchases</xsl:variable>
<Days>
<xsl:for-each select="/Days/Day">
<Day>
<xsl:copy-of select = "Date" />
<Restaurants>
<xsl:for-each select="/Days/Day/Restaurants/Restaurant/Data">
<Restaurant>
<xsl:copy-of select = "../RestaurantId" />
<Data>
--> <xsl:copy-of select = "$sValue" />
<xsl:copy-of select = "Sales" />
</Data>
</Restaurant>
</xsl:for-each>
</Restaurants>
</Day>
</xsl:for-each>
</Days>
</xsl:template>
I'm trying to create my Xpath in a variable and give to the copy-of function. The problem is the xml result. The xpath is not execute by the copy-of function, the xpath is displayed on the screen! What's i'm doing wrong???
I'm doing it because my xpath is normally in another xml file.
This is the xsl code
Thanks!
<xsl:template match="/" >
<xsl:variable name="sValue">Purchases</xsl:variable>
<Days>
<xsl:for-each select="/Days/Day">
<Day>
<xsl:copy-of select = "Date" />
<Restaurants>
<xsl:for-each select="/Days/Day/Restaurants/Restaurant/Data">
<Restaurant>
<xsl:copy-of select = "../RestaurantId" />
<Data>
--> <xsl:copy-of select = "$sValue" />
<xsl:copy-of select = "Sales" />
</Data>
</Restaurant>
</xsl:for-each>
</Restaurants>
</Day>
</xsl:for-each>
</Days>
</xsl:template>