how to trace by carriage return in a string
i m facing small issue my xml which looks like this mentioned as bellow for this i m writting a logic in xslt but i cant able to re开发者_Python百科ach output can any one help me please kindly asap here my XML
<block4>
<tag>
<name>72</name>
<value>/BNF/
FETA/ABNAAFU000000D93--16.560-10/</value>
</tag>
</block4>
here my XSL
<xsl:for-each select="block4/tag[name = '72']">
<xsl:value-of select="concat((concat(substring-before(value,' '),',')),(substring-after(value,' '))) "/>
</xsl:for-each>,<xsl:text/>
output required: /BNF/,FETA/ABNAAFU000000D93--16.560-10/
note : i am trying to get output as such LINE1,LINE2
Well I'm not exactly sure what you're trying to do, but I think a combination of the normalize-space
and translate
functions are what you want, something like this:
<xsl:for-each select="block4/tag[name = '72']">
<xsl:value-of select="translate(normalize-space(value), ' ', ',')"/>
</xsl:for-each>,<xsl:text/>
The normalize-space
will turn all whitespace into spaces, and convert multiple spaces into a single space. The translate
will turn all the remaining spaces into commas.
精彩评论