|
RE: distinct-values( ) appears to return empty for any sequence of nodes.: msg#00097text.xml.saxon.help
distinct-values() atomizes the nodes supplied in the input sequence and returns the set of distinct atomic values that appear in these nodes. The result of atomizing (<one/>,<one/>,<two/>) is an empty sequence (because each of the nodes is an empty element), and therefore the result of distinct-values() is also an empty sequence. What result did you expect? Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: saxon-help-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx > [mailto:saxon-help-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx] > On Behalf Of > Benjamin Jones > Sent: 16 June 2005 21:07 > To: saxon-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx > Subject: [saxon] distinct-values( ) appears to return empty > for any sequence of nodes. > > I have a problem with distinct-values using Saxon 8.4 > > If I run the following XQuery: > ----------------begin XQuery ---------------- > let $x:=(<one/>,<one/>,<two/>) > let $y:=(1,1,2) > return > <answers> > <nodeDistinct>{distinct-values($x)}</nodeDistinct> > <valueDistinct>{distinct-values($y)}</valueDistinct> > </answers> > -------------- end XQuery ---------------- > > I get the result > --------------begin Result ------------------------ > <?xml version="1.0" encoding="UTF-8"?> > <answers> > <nodeDistinct/> > <valueDistinct>1 2</valueDistinct> > </answers> > --------------end Result -------------------------- > > It seems that distinct-values fails silently on any sequence > of nodes. > Am I missing something > in the spec for XQuery 1.0 that forbids using a sequence containing > nodes of type element or document? > > Thanks, > > Ben > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > saxon-help mailing list > saxon-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx > https://lists.sourceforge.net/lists/listinfo/saxon-help > ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Template recursion, StackOverflowError, saxon:while a nd variable assignability: 00097, Dimitre Novatchev |
|---|---|
| Next by Date: | RE: Template recursion, StackOverflowError, saxon:while a nd variable assignability: 00097, Michael Kay |
| Previous by Thread: | distinct-values( ) appears to return empty for any sequence of nodes.i: 00097, Benjamin Jones |
| Next by Thread: | Extension functions: array conversion bug: 00097, Wolfgang Hoschek |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |