Hello group,
I use XSLT to output a unix shell script based on the content of an XML
file :
The XSLT :
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<xsl:template name="haut" match="/rhythmdb">
#!/bin/bash
cd /pub/html/zicmu2/links
<xsl:for-each select="entry">
<xsl:sort select="locatio n"/>
ln -s "<xsl:value-of select="substri ng-after(location, 'file://')"/>"
<xsl:choose>
<xsl:when test="starts-with(location,' file:///pub/joe/misc')">
"<xsl:value-of select="substri ng(location, 22)"/>"
</xsl:when>
<xsl:otherwis e>
"<xsl:value-of select="substri ng(location, 19)"/>"
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
After conversion (with xsltproc/libxml)
#!/bin/bash
cd /pub/html/zicmu2/links
ln -s "data1"
"to_data1"
ln -s "data2"
"to data2"
So I have many unwanted carriage returns/whitspaces. (it follows the
indentation of my .XSL...)
I googled around and saw <xsl:text> ?
Didn't work 'cause my XML file has unsupported char.
Help Welcomed.
Thks.