[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: having problem implementing 'strip-space'

Subject: Re: having problem implementing 'strip-space'
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Mon, 27 Jan 2003 23:23:09 +0100
javascript strip spaces
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: &#9; (Tab), &#10; + &#13; (line feed + carriage return), &#20; (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>

								<img
border="0" width="150">
	
<xsl:attribute name="src">
	
<xsl:text>../fig/thm/</xsl:text>
	
<xsl:value-of select="$imagefilename" />
	
<xsl:text>.jpg</xsl:text>
	
</xsl:attribute>
	
<xsl:attribute name="alt">
	
<xsl:value-of select="$imagefilename" />
	
</xsl:attribute>
	
<xsl:attribute name="name">
	
<xsl:text>my</xsl:text>
	
<xsl:value-of select="$imagefilename" />
	
</xsl:attribute>
								</img>

							</a>
							<br/>
						</td></tr>
					</xsl:for-each>

----------------------------------------------------------------------------
--------------------------------
----------------------------------------------------------------------------
--------------------------------
I've tried every implementation of: <xsl:strip-space elements="*"/>
imaginable.

I stumbled upon a suggestion to use the 'normalize()' function just recently
in relation to this sort of problem. Does anyone know how it might be
implemented in this scenario?
----------------------------------------------------------------------------
--------------------------------

Thanks in advance,
Steve




****************************************************************************
This email may contain confidential material.
If you were not an intended recipient, please notify the sender and delete all copies.
We may monitor email to and from our network.


****************************************************************************



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list





XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.