Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


question

From: Juan-Carlos Cardenas (cards4@-------.---)
To: NULL
Date: 1/4/2005 11:54:00 AM
Hello,
      I'm trying to capture elements from an XML document by using an XSL document that splits the XML elements with a comma.  When I apply my XSL with the XML, it gives all of the elements followed by a comma, but the last element has a comma attached to it also.  I don't want that last comma.  What can I do to get rid of the comma that is attached to the last element.  

Here is my XSL file!!!

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/eBay/*"/>
<xsl:template match="/eBay/WatchList">
<xsl:for-each select="Items/Item">
<xsl:apply-templates select="Id"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="Id">
<xsl:for-each select=".">
<xsl:choose>
<xsl:when test="not(Id = '.' )">
<xsl:value-of select="."/>
<xsl:text>,</xsl:text>
</xsl:when>		
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent