[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problem in XSL transformation
Hi All, We want to transform a particular XML file which contains elements in a loop. We want to append a symbol as the header for each iteration. The symbol list is a string which contains individual symbols separated by pipeline (|). For example, if the symbol list is abc|def, in first iteration we want abc as the header and in the second iteration, we want def as the header. The code which we are using is as follows. <xsl:template name="add_symbol_to_output"> <xsl:param name="str"/> <xsl:choose> <xsl:when test="contains($str,'|')"> <xsl:value-of select="substring-before($str,'|')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$str"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:for-each select="root/firstChild"> <xsl:variable name="inputParam" select="$inputSymbol"/> <xsl:call-template name="add_symbol_to_output"> <xsl:with-param name="str" select="$inputParam"/> </xsl:call-template> <xsl:variable name="inputSymbol" select="substring-after($inputSymbol,'|')"/> <xsl:text>,</xsl:text> <xsl:value-of select="fid[@id='SAMPLEID_1']"/> <xsl:text>,</xsl:text> We are getting the same header, i.e. abc for all iterations. Any clues? Thanks & Regards, Ambika Prasad Das
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|