logo       

RE: XQuery question: msg#00192

text.xml.exist

Subject: RE: XQuery question

Hi Jonathan,

> I am struggling with an xquery problem and I would be very grateful
> for any advice.

I'm not completely sure I understand what you need, but here's a query on
your data that might give you some ideas:

distinct-values(tokenize(string-join(//link/@targets[. |= $id], ' '),
'\s+'))

This will give you a list of (distinct) letters that you can iterate over.
(If you'd rather have it as a single string, in the format of the targets
attribute, just string-join it again.) Note that I have no idea whether
this is in fact faster than your current approach -- I suspect it does
much the same thing under the covers.

-- P.

--
Piotr Kaminski (piotr@xxxxxxxxxxxx)
It's the heart afraid of breaking that never learns to dance.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise