Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
XML
XSL : unwanted carriage returns/white space
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Patrick TJ McPhee, post: 771018"] [...] % So I have many unwanted carriage returns/whitspaces. (it follows the % indentation of my .XSL...) % I googled around and saw <xsl:text> ? This is what you want to use. If you have non-whitespace text in a template, then all the text in the template, including all the white space, gets copied to the result tree. If you wrap all your non-whitespace text in xsl:text elements, then only the text in the xsl:text elements, along with text generated by other xsl elements, will be copied. % Didn't work 'cause my XML file has unsupported char. I expect you put one of your value-ofs inside a text element. This works the way you want it to: <xsl:stylesheet xmlns:xsl="[URL]http://www.w3.org/1999/XSL/Transform[/URL]" version="1.0"> <xsl:output method="text"/> <xsl:template name="haut" match="/rhythmdb"> <xsl:text>#!/bin/bash cd /pub/html/zicmu2/links </xsl:text> <xsl:for-each select="entry"> <xsl:sort select="location"/> <xsl:text>ln -s "</xsl:text> <xsl:value-of select="substring-after(location,'file://')"/> <xsl:text>" "</xsl:text> <xsl:choose> <xsl:when test="starts-with(location,'file:///pub/joe/misc')"> <xsl:value-of select="substring(location, 22)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="substring(location, 19)"/> </xsl:otherwise> </xsl:choose> <xsl:text>" </xsl:text> </xsl:for-each> </xsl:template> </xsl:stylesheet> [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
XML
XSL : unwanted carriage returns/white space
Top