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

RE: How to trim leading and trailing spaces in xsl:at

Subject: RE: How to trim leading and trailing spaces in xsl:attribute?
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Thu, 26 May 2005 02:05:26 -0700 (PDT)
xsl trim
Hi Mike,
  Where we must specify xml:space="preserve" attribute
(to preserve whitespace only text nodes in
stylesheet)?

Would it be at this tag -
<xsl:stylesheet xml:space="preserve" ...

Regards,
Mukul

--- Michael Kay <mike@xxxxxxxxxxxx> wrote:
> You can write
> 
> <xsl:attribute name="x">
>   <xsl:value-of select="abc"/>
> </xsl:attribute>
> 
> Whitespace-only text nodes in a stylesheet are
> ignored, unless you specify
> xml:space="preserve" (which I wouldn't recommend).
> 
> Michael Kay
> http://www.saxonica.com/ 
> 
> > -----Original Message-----
> > From: Karr, David [mailto:david.karr@xxxxxxxx] 
> > Sent: 25 May 2005 18:41
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  How to trim leading and trailing
> spaces in 
> > xsl:attribute?
> > 
> > I have an "<xsl:attribute>" element in my
> stylesheet, and its value is
> > an "<xsl:value-of>" reference which then calls an
> XPATH function.  The
> > resulting single line is a little ugly.  I'd like
> to format 
> > the line so
> > it's a little more readable.  Unfortunately, I
> appear to be limited by
> > the semantics of the "<xsl:attribute>" element. 
> It does not trim
> > leading and trailing spaces, and it encodes any
> newlines found in the
> > resulting value.
> > 
> > I'm using JDK 1.4.2, in case there are constraints
> in the native TRAX
> > implementation inherent in that.
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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.