{{ ty's engineering log }}
non-optimized bits & pieces of my techincal side
Wednesday, October 28, 2009
Getting the nearest xpath ancestor
Given the following xml fragment:
1
2
3
4
5
<a>
<a>
<b
/>
</a>
<a>
To find the nearest ancestor <a/> w.r.t <b/>, i use:
//b/ancestor::a[1]
That's all !!
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Labels
cross-stub
(5)
design
(1)
encoding
(1)
firefox
(1)
i18n
(1)
javascript
(1)
jruby
(1)
linux
(10)
meta-programming
(3)
misc
(6)
notice
(1)
otaku
(2)
pdf
(1)
rails
(2)
rake
(1)
ruby
(24)
test
(8)
this
(2)
tips
(2)
vim
(1)
xpath
(4)
Blog Archive
►
2010
(21)
►
August
(4)
►
July
(15)
►
March
(1)
►
February
(1)
▼
2009
(21)
►
December
(3)
►
November
(7)
▼
October
(10)
Finding the position of an element
Finding Common Elements in Ruby Arrays
Getting the nearest xpath ancestor
Renaming a screen window
Smart click_button
Smart click_link()
Workaround for Webrat's have_xpath()
Webrat's have_xpath() in diff modes
2 Way to Fetch a Node's Attribute Value
Fixing Gnome Tooltip
►
September
(1)
No comments:
Post a Comment