有关XPath的一个小问题,50分!!!
<script>
var oXmlDoc= new ActiveXObject("Microsoft.XMLDOM");
oXmlDoc.loadXML("<root><child>A</child><child>B</child><child>C</child></root>");
oXmlDoc.createProcessingInstruction("xml", "version=\"1.0\"")
oRoot=oXmlDoc.documentElement;
alert(oRoot.selectNodes("child[@text='C']").length);//期望是1,怎么实现?
</script>
问题点数:50、回复次数:1Top
1 楼colee(冷面 ◎ 虚者神头)回复于 2003-12-02 17:48:27 得分 50
alert(oRoot.selectNodes("child[.='C']").length);
Top




