I sent an email yesterday, but maybe it didn't got through.
Anyway, this is it:
I have this simple markup:
componentDom.innerHTML =
<form action=""> <h1 name="formTitle"></h1>
<p name="formInstructions"></p>
<div name="top">
</div>
<div name="formContent">
<divname="column"><div ></div></div>
</div>
<div name="bottom">
<input type="submit" name="defaultButton" value="Submit"/>
</div>
</form>
<p name="formInstructions"></p>
<div name="top">
</div>
<div name="formContent">
<divname="column"><div ></div></div>
</div>
<div name="bottom">
<input type="submit" name="defaultButton" value="Submit"/>
</div>
</form>
I'm executing this xpath calls with the following results:
$('form/[EMAIL PROTECTED]', componentDom).length = 3
$('form/[EMAIL PROTECTED]', componentDom)[0].innerHTML = ""
$('form/[EMAIL PROTECTED]', componentDom)[1].innerHTML = "<DIV name=\"column\">
<DIV></DIV></DIV>"
$('form/[EMAIL PROTECTED]', componentDom)[2].innerHTML "<INPUT type=submit value=Submit name=defaultButton> "
$('form/[EMAIL PROTECTED]/input', componentDom) Object required Error
$('//div', componentDom) 'undefined' is null or not an object Error
$('form//div', componentDom).length = 6
$('form//div/input', componentDom).length = Object required Error
I don't understand why it's failing. I'm just asking for the input which it's obviously there, under the last DIV. Like this, I've come across many really simple XPath queries that just don't work. Am I doing something wrong? Is it XPath actually supported?
Moreover:
Thos queries that return an error, like:
$('form//div/input', componentDom);
break in the sibling function(elem, pos, not) since elem is null. Probably this is related to the bug where children() breaks when there are no children.
I know jQuery doesn't support the full XPath standard but as you can see my expressions are really simple, and anyway it shouldn't break.
Thanks
On 10/3/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
Raziel Alvarez schrieb:
> I've been testing and I see many really simple XPath queries that just
> don't work, or they even break.
>
> Is this broken in jQuery? Are they working for somebody?
jQuery does not claim to implement the XPath standard. It just supports
a small subset, and these should work. Could you provide more specific
examples that don't work?
-- Jörn
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
