[Jprogramming] xpath?

Raul Miller rauldmiller at gmail.com
Tue Jul 20 03:36:30 HKT 2010


On Mon, Jul 19, 2010 at 3:17 PM, Raul Miller <rauldmiller at gmail.com> wrote:
> Given an xpath and an xml document, I would like to create the bit
> vector which selects the characters from the xml document which
> correspond to text which would be selected by that xpath.  Or I could
> probably live with a boxed list of the selected items.

Speaking of which, to go from the first representation to the second,
does anyone have anything better than:
st=. 0 1 E. 0,[
bv=. st +. 0,[
bl=. (bv # st) <;._1 bv # ' ',]
bparse=: bl f.
Example use:
 (e.&(64}.a.) bparse ]) 'this is a test'
(given a selection vector and a list, it returns the selected elements
from the list, boxed, with contiguous elements from the original list)
Thanks,
-- 
Raul


More information about the Programming mailing list

AltStyle によって変換されたページ (->オリジナル) /