Hello group,
I use XSLT to output a unix shell script based on the content of an XML file :
The XSLT :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl
utput method="text"/> <xsl:template name="haut" match="/rhythmdb">
#!/bin/bash
cd /pub/html/zicmu2/links
<xsl:for-each select="entry">
<xsl:sort select="location"/>
ln -s "<xsl:value-of select="substring-after(location,'file://')"/>" <xsl:choose> <xsl:when test="starts-with(location,'file:///pub/joe/misc')"> "<xsl:value-of select="substring(location, 22)"/>" </xsl:when> <xsl
therwise> "<xsl:value-of select="substring(location, 19)"/>" </xsl
therwise> </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.
I use XSLT to output a unix shell script based on the content of an XML file :
The XSLT :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl
#!/bin/bash
cd /pub/html/zicmu2/links
<xsl:for-each select="entry">
<xsl:sort select="location"/>
ln -s "<xsl:value-of select="substring-after(location,'file://')"/>" <xsl:choose> <xsl:when test="starts-with(location,'file:///pub/joe/misc')"> "<xsl:value-of select="substring(location, 22)"/>" </xsl:when> <xsl
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.