Thanks. That works. It's been a while since I've done complex XPaths
and I was getting '.' confused with '*'. Also it appears that

  /text()[not(.='\n')]

works but XPather appears to not parse escaped characters, so the
example doesn't work in XPather.

On Nov 29, 5:21 pm, esquifit <[email protected]> wrote:
> Maybe this?
>
>  //text()[not(normalize-space(.)="")]
>
> On Sun, Nov 29, 2009 at 10:49 PM, RodMcguire <[email protected]> wrote:
> > I have webpage whose source looks like this:
>
> >  <font>
> >  <br>
> >  head 1<br>
> >  <a>link 1</a><br>
> > , <a>link 2</a><br>
> >  <br>
> >  head 2<br>
> >  <a>link 3</a><br>
> >  </font>
>
> > I want to use XPath to extract the <a> nodes and those #text nodes
> > that do not contain just '\n', as an ordered snapshot.The followinging
> > XPath works as an initial approximation
>
> >    //font/a|//font/text()
>
> > but from testing in XPather I have found no way to exclude the \n text
> > nodes. These examples don't work:
>
> >   //text()[not(*='\n')]
> >   //text()[not(text()='\n')]
> >   //text()[not(string-length(*)=1)]
> >   //text()[not(string-length(text())=1)]

--

You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.


Reply via email to