Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: XPath for non-empty #text nodes (tDOM)

Reply
Thread Tools

Re: XPath for non-empty #text nodes (tDOM)

 
 
Richard Tobin
Guest
Posts: n/a
 
      04-09-2008
In article <(E-Mail Removed)>,
Mikhail Teterin <(E-Mail Removed)> wrote:

>What's would be the syntax for a query, which would allow me to get only the
>elements with non-empty text-nodes?


Presumably you mean direct text children (rather than descendants),
and by "non-empty" you mean "containing something other than whitespace".

If so, try

*[normalize-space(text()) != ""]

(or with // at the start, depending on the context).

-- Richard
--
:wq
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text nodes and element nodes query asd Java 3 05-23-2005 10:01 AM
finding nodes that don't match other nodes mlybarger@gmail.com XML 2 01-27-2005 07:26 PM
Looking A Nodes From Within Nodes Johnny Ooi XML 10 11-14-2004 06:55 PM
selecting nodes between other nodes Timo Nentwig XML 1 06-17-2004 04:54 AM
Reality check: Is it sensible to link XML nodes to other XML nodes in the same file? gavnosis XML 0 08-02-2003 08:22 AM



Advertisments