[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: When to use text()
On Fri, Mar 21, 2014 at 5:40 PM, Graydon <graydon@xxxxxxxxx> wrote: > On Fri, Mar 21, 2014 at 05:19:32PM +0000, Ihe Onwuka scripsit: >> The quirkiness of the definition derives not from the definition >> itself, because there may well be justification for the existence of a >> node type that encompasses text with embedded comments. Thats OK. > > There isn't, though. text nodes have no name and a string and no node > children. > > Text nodes are guaranteed leaves, like everything else except for > element nodes and document nodes. > >> The quirkiness derives from giving it an innocuous intuit inducing >> moniker like text() that leads the consumer astray. >> >> Let me parallel. If you call a concept Nothing and then occasionally >> allow it to contain Something, RTFTM is not appropriate because the >> fault lies in labelling that concept Nothing. > > But it doesn't. The parent element does. The issue is not that there > might be a comment node in the text node, but that there might be a > comment node child of the parent element node that separates the string > contents of the element into two or more text node children. > If it's a guaranteed leaf you shouldn't get the contents of anything else when you ask for it.
|
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
|