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

Whitespace problem

Subject: Whitespace problem
From: "Richard Lander" <rlander@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jun 1999 13:33:56 -0400
javascript alert whitespace
 Hello,

I am having quiet a bit of trouble with whitespace. I'd like to capture the
text of a particular element in a javascript array, so that I can retrieve
it from another window, when it is opened. I thought of using the DOM for
this purpose but would like to stick to XSL and Javascript. Anyways, I can't
seem to capture this text since all of the carriage returns in my source are
preserved, which Javascript doesn't like.

My question: How do I force XSL to strip out the carriage returns in the
text of an element? I am using the 1998-12-16 draft, as I want to stay
compatible with IE5.

I've tried:

<xsl:template match='MCOMMENT'>
 <A><xsl:attribute name="href">#</xsl:attribute>
 <xsl:attribute
name="onclick">javascript:alert('<xsl:apply-templates/>');</xsl:attribute>
 <IMG src="&images;mcomment.gif" border="0"/>
 </A>
</xsl:template>

<xsl:strip-space element="MCOMMENT/PARA"/>

<xsl:template match='MCOMMENT/PARA'>
 <xsl:apply-templates/>
</xsl:template>


Note: MCOMMENT only contains PARA elements.

I've also tried adding the following as an attribute in the xsl:stylesheet
element:

default-space="strip"

Still, the output of MCOMMENT/PARA includes preserved carriage-returns. What
gives?

Note: I'm currently using an alert box, as you may see, as opposed to a
proper window, until I can get the whitespace problem fixed.

Thanks,

Richard.


Richard Lander
relander at uwaterloo.ca
http://pdbeam.uwaterloo.ca/~rlander/

Professional XML Authoring
http://www.on-line-learning.com/



 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.