Reputation: 1251
i have an xml on which i apply an xsl and convert to another xml.
The source xml contains a node which gets repeated like this
<node>123</node>
<node>456</node>
<node>789</node>
I am applying xsl like this
<Node><xsl:value-of select="MT[@N='node']/@V"/></Node>
the resulting xml is like this
<Node>123 456 789</Node>
it automatically gets separated by space.
But how can get the values separated by some character like * instead of space.
Upvotes: 0
Views: 227
Reputation: 163322
It looks like you are using XSLT 2.0, and the space is appearing because this is the default value of the "separator" attribute. For a different separator such as comma, use
<Node><xsl:value-of select="MT[@N='node']/@V" separator=","/></Node>
Note that in XSLT 1.0, this instruction would only output the first @V attribute and ignore the rest.
Upvotes: 1
Reputation: 56162
or <xsl:apply-templates>
http://www.w3schools.com/xsl/xsl_apply_templates.asp
Upvotes: 0
Reputation: 3768
You could use a foreach loop in XSLT to append each string, see:
http://www.w3schools.com/xsl/xsl_for_each.asp
Upvotes: 0