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

RE: Empty elements

Subject: RE: Empty elements
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Thu, 21 Sep 2000 14:48:18 +0100
download saxon 5.3.2
Nick Browne

> Dave, I added another node to your test : 
<node id="id04"><x> </x></node>
> i.e. a non-empty descendent of a node without text children.
> 
> Results were : Instant Saxon 5.3.2 -->  Node: id04 is not empty using
> string(.)
>                                                             
> Node: id04 has
> children

> This then brings us round to the meaning of stripping of pure 
> white space
> text nodes - so its back to the spec(s) and FAQs then !

gut reaction (I can see DC cringing :-) would be that id04 is
not empty (it has children). The fact that the child element
is 'empty' (my defn) is for later.
 My simplistic view is that we are talking about *this* element,
not its children, grandchildren etc.

I tried 
<node id="id05"> <x> </x></node>
<node id="id06"> <x></x></node>

Both of these show up as not empty using string().
 Again this feels about right.
  
for all the purposes I have needed to date :-)
 I'd like a test for 'empty' (my definition), to exclude
 any element which has children. I.e. I'm likely to 
be testing for such as empty table cells, paragraphs,
basically elements which have either mixed or pcdata content.
 I'd most likely want to recognise and treat differently
nodes which have child elements.

I'm happy with Saxon's definition.

Regards DaveP




 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.