这是我的一块XML文档:纠正这个XPath表达式请
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<mfVictor>
<decal>
<company>Victor</company>
<title>Wood Horn with Blue Background</title>
<image>
<url>victor01.jpg</url>
<width>60</width>
<height>60</height>
<name>Wood Horn Blue Background</name>
<link></link>
</image>
<price>$15.00</price>
<instock>In Stock</instock>
<notes>none</notes>
</decal>
</mfVictor>
</catalog>
我有一个生成每个“标题”元素的文本列表的功能。那么,我希望导航到“贴花”并访问其所有子项的每个列表项的onmousedown。到目前为止,我有这个:
//decal[contains(.,\'"+itemName+"\')]
其中itemName是this.innerHTML传递给函数。它看起来像decal被访问,因为在console.log中,我可以看到长度为1的XMLobject。但我无法弄清楚如何访问“decal”的子项或“title”的兄弟。
感谢您的阅读。
这就解释了它。我需要你的最后一个例子。谢谢! – Troy 2010-06-27 23:32:08