Sign Up
Search
Options
search
Chat
Help
News
Log in
Not Logged in
Home
»
Boards
»
Stylus Studio Developer Network
»
Stylus Studio Technical Forum
»
Looping - Taking the comma out
Topic
Topic Page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Prev Topic
Next Topic
next
Subject:
Looping - Taking the comma out
Author:
Jon Gallegos
Date:
16 Apr 2009 12:52 PM
Please take note fo the commas
Here is my code
<item name="Pname">
<text>
<xsl:for-each select="a:Form/a:UserValue/a:Item">
<xsl:value-of select="@value"/>,
</xsl:for-each>
</text>
</item>
This is what I am getting
<text>WADDING COVER A, COVER PIVOT BASE R,</text>
This is what I want
<text>WADDING COVER A, COVER PIVOT BASE R</text>
How can I get to were i want to go?
next
Subject:
Looping - Taking the comma out
Author:
Tony Lavinio
Date:
17 Apr 2009 09:47 AM
Well, for the document
<root>
<row>a</row>
<row>b</row>
<row>c</row>
</root>
A solution that would produce "a,b,c" is this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="root/row">
<xsl:value-of select="."/>
<xsl:if test="position() < last()">
<xsl:text>,</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
You should easily be able to adjust it to your need.
top
Subject:
Looping - Taking the comma out
Author:
Jon Gallegos
Date:
21 Apr 2009 10:58 AM
Thanks
That did the trick
Topic Page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Prev Topic
Next Topic
Powered by
Stylus Studio
, the world's leading
XML IDE
for
XML
,
XSLT
,
XQuery
,
XML Schema
,
DTD
,
XPath
,
WSDL
,
XHTML
,
SQL/XML
, and
XML Mapping
!
Go to Conference:
Select Conference
Stylus Studio Feature Requests
Stylus Studio Technical Forum
Website Feedback
XSLT Help and Discussion
XQuery Help and Discussion
Stylus Studio FAQs
Stylus Studio Code Samples & Utilities
Stylus Studio Announcements
go
Log In Options
Username:
Password:
Site Map
|
Privacy Policy
|
Terms of Use
|
Trademarks
Stylus Scoop XML Newsletter:
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.