Subject: Re: [xsl] variable never matched hardcoded string From: Joerg Heinicke <joerg.heinicke@xxxxxx> Date: Thu, 25 Jul 2002 06:39:31 +0200 |
Hi, Basically, what I'm trying to do is to assign each value of <dataValue> into a particular variable based on it attribute(fid). My problem is, the ** part never matched and also I would like to know if this is the right thing to do it.
Thanks.
maizatul
xml ---- <message> <dataContent> <dataValue fid="R055">706</dataValue> <dataValue fid="R039">1066</dataValue> ......
</dataContent> </message>
xslt --- <xsl:template match="message">
<xsl:variable name="ABC"> <xsl:call-template name="xyz"> <xsl:with-param name="p_Code">stock</xsl:with-param> </xsl:call-template> </xsl:variable>
<xsl:variable name="ABC"> <xsl:call-template name="xyz"> <xsl:with-param name="p_Code">action</xsl:with-param> </xsl:call-template> </xsl:variable>
....... .......
</xsl:template>
<xsl:template match="dataContent/dataValue">
<xsl:param name="p_Code">
<xsl:apply-templates select="dataContent/dataValue"/>
<xsl:if test = "normalize-space($p_code) = 'stock')"> **
<xsl:if test = "consist(@fid,'039')">
<xsl:value-of select=(.)> </xsl:if> </xsl:if> <xsl:if test = "normalize-space($p_code) = 'action')"> ** <xsl:if test = "consist(@fid,'055')"> <xsl:value-of select=(.)> </xsl:if> </xsl:if> .........
</xsl:template>
<xsl:template match="message"> <xsl:variable name="ABC"> <xsl:apply-templates select="dataContent/dataValue"> <xsl:with-param name="p_Code" select="'stock'"/> </xsl:apply-templates> </xsl:variable> <xsl:variable name="DEF"> <xsl:apply-templates select="dataContent/dataValue"> <xsl:with-param name="p_Code" select="'action'"/> </xsl:apply-templates> </xsl:variable> </xsl:template>
<xsl:template match="dataContent/dataValue"> <xsl:param name="p_Code" select="''"/> <xsl:choose> <xsl:when test="$p_code = 'stock' and contains(@fid, '039')"> <xsl:value-of select="."/> </xsl:when> <xsl:when test="$p_code = 'action' and contains(@fid, '055')"> <xsl:value-of select="."/> </xsl:when> </xsl:choose> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] variable never matched hardco, Maizatul Alma Elias | Thread | Re: [xsl] variable never matched ha, Maizatul Alma Elias |
[xsl] variable never matched hardco, Maizatul Alma Elias | Date | Re: [xsl] math get maximum and subt, sascha |
Month |