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

Discussion in 'XML' started by Richard Tobin, Apr 9, 2008.

  1. In article <>,
    Mikhail Teterin <> 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
     
    Richard Tobin, Apr 9, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. asd
    Replies:
    3
    Views:
    440
    Arnaud Berger
    May 23, 2005
  2. Xamle Eng

    Why treat text nodes as nodes?

    Xamle Eng, May 13, 2005, in forum: XML
    Replies:
    8
    Views:
    496
    Fredrik Lundh
    May 28, 2005
  3. Richard Tobin
    Replies:
    0
    Views:
    468
    Richard Tobin
    May 2, 2008
  4. Joseph J. Kesselman

    Re: more XPath struggles (tDOM)

    Joseph J. Kesselman, May 2, 2008, in forum: XML
    Replies:
    6
    Views:
    681
    Rolf Ade
    May 6, 2008
  5. Marek
    Replies:
    1
    Views:
    1,601
    Marek
    Jun 24, 2008
Loading...

Share This Page