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

RE: Normalize-Space for a template

Subject: RE: Normalize-Space for a template
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Fri, 2 May 2003 17:00:12 -0400
normalize space
[Karl J. Stubsjoen]

> I tried your approach.  It works well.
> Just wondering though:  is there a way to strip spaces from a 
> template that
> has been called?  My example of a URL and QUERY and DISPLAY 
> was a pretty
> simple one... if this was a much more complicated (involved) 
> template, it
> seems there must be a way to "STRIP" the spaces from this result.
> 

I think you do not quite have the right mental model here.  When your
template produces a result, it is added to the result tree.  In xslt
1.0, the result tree (and its fragments) are not accessible to a
template, because a result tree fragment is a different type from a
node-set.  Of course, there are non-standard vendor extensions that do
give a template access by converting nodes in the result tree into
regular node-sets.

Thus you have to normalize spaces on the various text fragments as they
are encountered in the template, not after the template has assembled
them.  You can also normalized spaces in a variable, as long as it is
not a result tree fragment.  In practice, this means that you can
normalize variables constructed like this -

<xsl:variable name = 'var1' select='..'/>

but not ones constructed like this -

<xsl:variable name='var1'>...</xsl:variable>

However, in the first case you could have normalized the value in the
select statement anyway.

Cheers,

Tom P

 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.