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

Re: XSLT: question re testing for possibly empty eleme

Subject: Re: XSLT: question re testing for possibly empty elements
From: Ralph Holz <ralph.holz@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 17 Aug 2004 11:17:35 +0200
eleme trademark
Hi,

Consider <foo> </foo> and <foo/>

"string-length(anElement) > 0" will return true for the first one,
"normalize-space()" will return false for both.

True!


I guess what the original author really meant was to check if the element is "empty or non-white" - because the data stored in anElement would be a car's license number and it makes no sense to return spaces (which are invisible on the print-out) when there's alternative data stored (which he retrieves in the otherwise-branch).

I reckon my test with normalize-space() is more accurate.

Thanks,
Ralph

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.