I'm trying the find a xml node with xpath query. but i cannot make it working. In firefox result is always "undefined" and chrome throws a error code.
<script type="text/javascript">
var xmlString = '<form><name>test</name></form>';
var doc = new DOMParser().parseFromString(xmlString,'text/xml');
var result = doc.evaluate('/form/name', doc,
null, XPathResult.ANY_TYPE, null);
alert(result.stringValue);
</script>
what's wrong with this code ?