[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Empty elements
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|