Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: DOM Vs XPath + ancestor : whats the point? >Thread Next - Re: DOM Vs XPath + ancestor : whats the point? Re: DOM Vs XPath + ancestor : whats the point?To: NULL Date: 8/3/2004 11:37:00 AM OK I think we have a basic difference of opion between what COULD be returned in the nodeset ... and what IS currently returned > somebody has to remove node <c> from <a>. No magic here, it's tree, not > flat list, if you select node <a>, then .xml property would give you > full subtree of <a>. I dont see any reason why this has to be done by additional coding when it is quite clear what the intent of the XPath ancessor::* is - to create a single node subset > What is weird is the following code: > > for (i=0;i<nodes.length;i++ ) > { > Response.write(nodes.nextNode().xml) > } > > It's too naive as it presumes nodes in the nodelist can't be overlapping > as in ancesor::* case - each one node contains immediately preceding one > as a child and others as descendants. And the first one - root element > contains all nodes in the tree (except document prolog). > Not if take the view that "distinct" root nodes COULD be returned in the nodeset . Looking at http://www.zvon.org/xxl/XPathTutorial/Output/example10.html its quite clear what could be returned - a 3 root node nodeset <BBB/> <CCC/> <CCC/> or for http://www.zvon.org/xxl/XPathTutorial/Output/example12.html its quite clear that two root nodes should be returned <BBB> <CCC/> </BBB> <CCC> <EEE/> </CCC> and similarly for ancestors example http://www.zvon.org/xxl/XPathTutorial/Output/example14.html a single root node nodeset <AAA> <BBB> <DDD> <CCC/> </DDD> </BBB> </AAA> Unfortunately the nodeset currently returned makes this unnecessary additional task! | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
