[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: having problem implementing 'strip-space'
Hello Steve,
your XSL processor seems to be buggy. "Empty" whitespace nodes are stripped by default in XSL (empty means consisting only of whitespace characters: 	 (Tab), + (line feed + carriage return),  (space)). You already use the correct solution with <xsl:text/>. You can try: <xsl:attribute name="href">javascript:bigFig('<xsl:value-of select="$imagefilename"/>', '../fig/big/<xsl:value-of select="$imagefilename"/>.jpg', '<xsl:value-of select="$imagefilename"/>');</xsl:attribute> (in one line without any whitespace character) or: <a href="javascript:bigFig('{$imagefilename}', '../fig/big/{$imagefilename}.jpg','{$imagefilename}');"/> (attribute value templates) Regards, Joerg Wright, Steve wrote: Hello, I am not having any luck getting my xslt scripts to remove the whitespace and carraige returns from my xml upon conversion to html. The main reason I need to have the space removed is that I have event handler's w/ javascript in them that are not working due to the carraige returns in the output which looks like this: ---------------------------------------------------------------------------- -------------------------------- <a href="javascript:bigFig(' FIG01-01','../fig/big/ FIG01-01.JPG ',' FIG01-01');"><img border="0" src="../fig/thm/ FIG01-01.JPG " alt=" FIG01-01" name="my FIG01-01"></a> ---------------------------------------------------------------------------- -------------------------------- ---------------------------------------------------------------------------- -------------------------------- the xsl looks like this: ---------------------------------------------------------------------------- -------------------------------- <xsl:for-each select="@NUM"> <xsl:variable name="imagelabel"><xsl:value-of select="../TTL" /></xsl:variable> <xsl:variable name="imagefilename"><xsl:value-of select="//CHAP/@NUM" />-<xsl:value-of select="." /></xsl:variable> <tr><td valign="top" class="text"> <a> <xsl:attribute name="href"> <xsl:text>javascript:bigFig('</xsl:text> <xsl:value-of select="$imagefilename" /> <xsl:text>','../fig/big/</xsl:text> <xsl:value-of select="$imagefilename" /> <xsl:text>.jpg','</xsl:text> <xsl:value-of select="$imagefilename" /> <xsl:text>');</xsl:text> </xsl:attribute> 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
|