[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: adding space in xslt and trimming last space in ja
Remko:
At 03:57 PM 7/16/2003, you wrote: I have an XML-file that contains a sequence of ids. I need to transform this to a String of space separated ids. This is rather extravagantly hopeful ain't it? (Do you try XSLT in your Java, too? :-) In any case, if you want a space after every value but the last, try something like <xsl:for-each select="//nsl:genbankid"> <xsl:value-of select="."/> <xsl:if test="not(position() = last())"> </xsl:if> </xsl:for-each> Any suggestions?? In VIM the transformed file shows not a space but a capital A with a ^ on top, I assume this is the problem. Nope: it's a red herring. You are seeing this because VIM does not support the encoding of your output (probably UTF-8). Use an editor that does, to get a better view of what's actually in your file; or change how your output is being serialized (on the xsl:output top-level element) to an encoding that your toolset supports. what can I use instead of  ?? You could use a plain space instead of the non-breaking one: <xsl:if test="not(position() = last())"> <xsl:text> </xsl:text> </xsl:if> assuming you don't mind that they break, of course. Cheers, Wendell
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|