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>
 
 
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:
 
Queries 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 at that same point when there are no children.
 
 
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to