Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
OK, these cases were'nt expected. In fact I had never seen <nobr> before. I
will add support for more tags.
Original comment by marc.r...@gmail.com
on 17 Apr 2012 at 5:38
Actually, I was looking at the source just now, and I realized that there's a
simpler and more robust way to implement this. If the XPath were something
along the lines of "//body//text()[not(parent::script)]" or
"//body//text()[not(ancestor::script)]", that would allow you to do it by
exclusion rather than inclusion; in your comment at this section you mention
that checking the parent's name causes problems because of case-sensitivity,
but checking it this way, by looking at the node type rather than its name,
averts that problem. It would also allow you to get most of the nodes in a
single operation. Of course, this does have the issue that you'd have to put
all the exclusion rules into one conditional.
Original comment by Zze...@gmail.com
on 17 Apr 2012 at 7:02
Thanks for the idea, I will try it ;)
Original comment by marc.r...@gmail.com
on 20 Apr 2012 at 9:34
As a side note: if you ever do need to do case-insensitive XPath comparisons,
you can use the translate function. As the spec (
http://www.w3.org/TR/xpath/#function-translate ) points out, there are
languages for which this won't work, but for most European languages it should
be fine.
Original comment by Zze...@gmail.com
on 20 Apr 2012 at 10:01
Fixed in r166 using a small variant of your suggestion. Thanks Zzedar!
Original comment by marc.r...@gmail.com
on 2 Dec 2012 at 5:08
Original issue reported on code.google.com by
Zze...@gmail.com
on 17 Apr 2012 at 3:07