Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: DOM Vs XPath + ancestor : whats the point?

From: "rvj" <md@----------.--->
To: NULL
Date: 8/3/2004 12:42:00 PM
..............however going back to my initial question is this the fault of
the XPATH spec or the MS node set,

............. I guess the answer is neither !


What I suppose is needed is a smarter selectNodes() method that returns
distinct roots


roots=xmldom.selectRoots("//RDF:Description[@role:area='US']/ancestor-or-sel
f::*")

        for (i=0;i<roots.length;i++ )
       {
                Response.write(roots.nextNode().xml)
        }

 Regards :)




"rvj" <md@r...> wrote in message
news:#WtgNTUeEHA.712@T......
> 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!
>
>
>
>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent