I have created a custom page template to perform specific transform based on the component droppped on the page. For specific component I need to add addditional div to contained them in containers. The problem is the transform is not working correctly. However if I take the output of the page template using the following:
<xsl:template match="node()|
@*">
<xsl:copy>
<xsl:apply-templates select="node()|
@*"/>
</xsl:copy>
</xsl:template>
And perform the transform locally it works as desried.
The xsl is as follows:
*********************************************************
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/">
<xsl:apply-templates select="/Page/Page_Display_Properties"/>
</xsl:template>
<xsl:template match="Page_Display_Properties">
<html xmlns="
http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title><xsl:value-of select="Title"/></title>
<xsl:if test="Description != ''">
<meta name="description" content="{Description}"/>
</xsl:if>
<xsl:if test="Keywords != ''">
<meta name="keywords" content="{Keywords}"/>
</xsl:if>
</head>
<body>
<div id="wrap">
<xsl:apply-templates select="/Page/Layout" mode="Tools">
<xsl:with-param name="divName">
<xsl:value-of select="'masthead'"/>
</xsl:with-param>
</xsl:apply-templates>
<div id="mainwrap">
<xsl:apply-templates select="/Page/Layout" mode="Tools">
<xsl:with-param name="divName">
<xsl:value-of select="'sidebarwrap'"/>
</xsl:with-param>
</xsl:apply-templates>
</div>
<div id="footerwrap"><img src="/images/footer.gif" /></div>
<div id="copyright">federal reserve bank of chicago</div>
<div id="quicklinks">
<a href="#">feedback</a> <a href="#">Phonebook</a>
</div>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="Layout" mode="Tools">
<xsl

aram name="divName" />
<xsl:for-each select="//ContainerProperties">
<xsl:variable name="ComponentID" select="
@ComponentID" />
<xsl:for-each select="/Page/ComponentData/Component[
@ID = $ComponentID]/div[
@id=$divName]">
<xsl:copy-of select="/Page/ComponentData/Component[
@ID =$ComponentID]/div[
@id=$divName]" />
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
**************************************************
For some reason its not matching the
for the component however when I run it locally on the xml document it matches correctly.
Please if somebody can shed some light on this issue.
Appreciate all the help.