Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Simple xPath. Specyfication lapse? Simple xPath. Specyfication lapse?To: NULL Date: 4/16/2009 3:48:00 PM Simple xml:
<root i="1">
<div i="2">
<other i="3">
<para i="4"/>
</other>
<para i="5"/>
</div>
</root>
Simple script:
var t=new ActiveXObject('msmlx2.domdocument.6.0');
t.async=false;
t.loadXML('<root i="1"><div i="2"><other i="3"><para i="4"/></other><para
i="5"/></div></root>');
tt=t.documentElement.selectNodes('div//para');
WScript.Echo(tt[0].xml)
Result: <para i="4"/>
Simple specyfication <http://www.w3.org/TR/1999/REC-xpath-19991116>:
"[...]
// is short for /descendant-or-self::node()/.
[...]
div//para is short for div/descendant-or-self::node()/child::para
[...]"
hmm... "div/descendant-or-self::node()/child::para"...
Step 1: "div", context: <root i="1">
Result 1: <div i="2">
Step 2: "descendant-or-self::node()", context: <div i="2">
Result 1: <div i="2">
Result 2: <other i="3">
Result 3: <para i="4">
Result 4: <para i="5">
Step 3.1: "child::para", context: <div i="2">
Result 1: <para i="5">
Ups...
;>
sz.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
