Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XPATH - the immediately preceding sibling

Status
Not open for further replies.

vistor

Technical User
Dec 22, 2000
164
US
Hi,

I'm trying to go to the immediately preceding sibling of the content node. I've tried preceding sibling::position()[1] but nothing returns.

Any suggestions?
 
Try: preceding-sibling::node()[position()-1]
The preceding-sibling specifies all previous nodes on the same axis - including namespaces and attributes. Using "node()" will exclude those.

- Ted
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top