[MarkLogic Dev General] issue with XPATH
Geert Josten
Geert.Josten at daidalos.nl
Thu Mar 26 13:14:12 PST 2009
Pradeep,
Yes, I think the result should be the same. It looks like the first approach is interpreted as (doc(..)//b)[position() = 2].
Eric,
Yes, a = b returns true if any item from sequence a is equal to any item in sequence b. You can best see it as an intersect on atomic values, returning all items in a that are also in b, but none in b that are not in a though..
Kind regards,
Geert
>
Drs. G.P.H. Josten
Consultant
http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit bericht kunnen geen rechten worden ontleend.
> From: general-bounces at developer.marklogic.com
> [mailto:general-bounces at developer.marklogic.com] On Behalf Of
> Eric Palmitesta
> Sent: donderdag 26 maart 2009 21:46
> To: General Mark Logic Developer Discussion
> Subject: Re: [MarkLogic Dev General] issue with XPATH
>
> Perhaps I spoke too soon!
>
> As I understand, A=B means "return true if A is found
> anywhere in the sequence B". Can someone confirm this?
>
> Thanks (and sorry to derail),
>
> Eric
>
> Eric Palmitesta wrote:
> > Equality testing of non-sequences should use "eq". Try...
> >
> > [position() eq 2]
> >
> > Eric
> >
> > Pradeep Maddireddy wrote:
> >> Hi..!
> >>
> >>
> >>
> >> I have a document with the following content
> >>
> >>
> >>
> >> <root>
> >>
> >> <a>
> >>
> >> <b id="1-1">1</b>
> >>
> >> </a>
> >>
> >> <a>
> >>
> >> <b id="2-1">1</b>
> >>
> >> <b id="2-2">1</b>
> >>
> >> </a>
> >>
> >> <a>
> >>
> >> <b id="3-1">1</b>
> >>
> >> <b id="3-2">1</b>
> >>
> >> </a>
> >>
> >> </root>
> >>
> >>
> >>
> >> I think both the following xpath expression should give the same
> >> result but they are giving different results, is it an issue in
> >> marklogic
> >>
> >>
> >>
> >> doc("/root/ab.xml")//b[position()=2]
> >>
> >>
> >>
> >> <b id="2-1">1</b>
> >>
> >>
> >>
> >> doc("/root/ab.xml")//b[2]
> >>
> >>
> >>
> >> <b id="2-2">1</b>
> >> <b id="3-2">1</b>
> >>
> >>
> >>
> >>
> >>
> >> Thanks
> >>
> >> Pradeep Maddireddy
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> ---
> >>
> >> _______________________________________________
> >> General mailing list
> >> General at developer.marklogic.com
> >> http://xqzone.com/mailman/listinfo/general
> > _______________________________________________
> > General mailing list
> > General at developer.marklogic.com
> > http://xqzone.com/mailman/listinfo/general
> _______________________________________________
> General mailing list
> General at developer.marklogic.com
> http://xqzone.com/mailman/listinfo/general
>
More information about the General
mailing list