JoeMcGarvey
Programmer
Hi,
I have two xslt templates. The second template is called (xsl:call-template) by the first template. The second template can also be rendered separately from the first template, so it stands alone. The first templates XML contains a node that defines the "src" of an "img" tag that is in the second template.
I have an xsl
aram "pageXML" that is set in the first template so the second called template knows which XML file to pull the "img src" value from.
FIRST TEMPLATE:
<xsl
aram name="pagexml"><xsl:value-of select="$xmlfile"/></xsl
aram>
<xsl:call-template name='pe_topnav'>
<xsl:with-param name='xmlfile'><xsl:value-of select='$global.path'/><xsl:value-of select='document($pagexml)//entity[@id="Navigation"]/value'/></xsl:with-param>
</xsl:call-template>
SECOND TEMPLATE:
<img border="0">
<xsl:attribute name="src">
<xsl:apply-templates select="document($pagexml)//entity[@id='NavigationPhoto']/value" mode="asset"></xsl:apply-templates>
</xsl:attribute>
</img>
PROBLEM:
The above works when rendering the first template because the param is defined. It fails when rendering the second template alone because the xsl
aram "pagexml" is "undefined".
QUESTION:
How can I write an xsl:choose statement to say "If xsl
aram("pagexml"
is undefined, set the "src" equal to "anotherimage.gif"?
Everytime I reference "$pagexml" in my if statement, I get the "undefined" error...
Thanks in advance!
Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -
I have two xslt templates. The second template is called (xsl:call-template) by the first template. The second template can also be rendered separately from the first template, so it stands alone. The first templates XML contains a node that defines the "src" of an "img" tag that is in the second template.
I have an xsl
FIRST TEMPLATE:
<xsl
<xsl:call-template name='pe_topnav'>
<xsl:with-param name='xmlfile'><xsl:value-of select='$global.path'/><xsl:value-of select='document($pagexml)//entity[@id="Navigation"]/value'/></xsl:with-param>
</xsl:call-template>
SECOND TEMPLATE:
<img border="0">
<xsl:attribute name="src">
<xsl:apply-templates select="document($pagexml)//entity[@id='NavigationPhoto']/value" mode="asset"></xsl:apply-templates>
</xsl:attribute>
</img>
PROBLEM:
The above works when rendering the first template because the param is defined. It fails when rendering the second template alone because the xsl
QUESTION:
How can I write an xsl:choose statement to say "If xsl
Everytime I reference "$pagexml" in my if statement, I get the "undefined" error...
Thanks in advance!
Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -