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

Re: check for whitespace value between nodes

Subject: Re: check for whitespace value between nodes
From: Liam R E Quin <liam@xxxxxx>
Date: Thu, 19 Aug 2010 16:07:16 -0400
Re:  check for whitespace value between nodes
On Thu, 2010-08-19 at 12:58 -0500, a kusa wrote:
> Hi
> 
> Is there any way in XSLT to check if the value between two nodes is a
> whitespace?
> 
> I tried normalize-space(product/text()) !=' ' but that is not working.
> I want tocheck if the actual value between <product> </product> is a
> white space.

Whitespace is a tricky thing to get right. It's impossible to give you a
good answer without knowing more about what you are trying to do and
why, and the context, and without seeing your XSLT.

In some contexts, . eq ' ' would work, for example, and in others you
might want data(.) eq ' ' (both assuming XSLT 2) or even something like,
    matches(., '^\s+$')

Liam

Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
XML Blog: http://www.barefootliam.org/

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.