Skip to main content

Bug Tracker

Side navigation

#144 closed bug (fixed)

Opened August 27, 2006 10:20PM UTC

Closed October 11, 2009 02:08PM UTC

support of ancestor:: axis

Reported by: stripTM Owned by:
Priority: undecided Milestone:
Component: ajax Version:
Keywords: xpath axis Cc: ""
Blocked by: Blocking:
Description

I am not able to succeed in xpath searches with axes. For example with simple searches as:

alert ($("//div/descendant::p").size());

I obtain the following error.

f has no properties (line 697) -> if ( f.constructor != String )

I am using the following version:

$Date: 2006-08-25 23:51:03 -0400 (Fri, 25 Aug 2006) $

Attachments (0)
Change History (4)

Changed August 31, 2006 06:23AM UTC by john comment:1

resolution: → wontfix
status: newclosed

That's correct - jQuery doesn't support the (explicit) descendant axis, instead, you can write the above using a combination of XPath and CSS Selectors:

$("//div p")

or more simply:

$("div p")

I don't really plan on including it, simply because it would add wait to the overall size of the file, without really adding any benefit.

Changed September 01, 2006 07:11AM UTC by striptm@yaho comment:2

keywords: → xpath axis
resolution: wontfix
status: closedreopened
summary: xpath search with axes doesn't worksupport of ancestor:: axis
type: bugfeature

Ok, and ancestor:: ancestor-or-self:: axis is supported?

is better to use .ancestors()?

Changed September 14, 2006 02:49AM UTC by john comment:3

resolution: → fixed
status: reopenedclosed

Correct, please use the additional methods for this, as opposed to the selectors.

Changed October 11, 2009 02:08PM UTC by dmethvin comment:4

component: → ajax
description: I am not able to succeed in xpath searches with axes. For example with simple searches as:\ \ alert ($("//div/descendant::p").size());\ \ I obtain the following error.\ \ f has no properties (line 697) -> if ( f.constructor != String )\ \ I am using the following version:\ $Date: 2006-08-25 23:51:03 -0400 (Fri, 25 Aug 2006) $I am not able to succeed in xpath searches with axes. For example with simple searches as: \ \ alert ($("//div/descendant::p").size()); \ \ I obtain the following error. \ \ f has no properties (line 697) -> if ( f.constructor != String ) \ \ I am using the following version: \ $Date: 2006-08-25 23:51:03 -0400 (Fri, 25 Aug 2006) $
need: → Review
priority: → blocker
resolution: → fixed
status: newclosed
type: → bug

Reopened by spammer.