For example, say I find the slice I want using ref and store the start and end points in symbols:
Code: Select all
(println start-pos)
;-> ((0 3 1072))
(println end-pos)
;-> ((0 3 4973))
Code: Select all
(println start-pos)
;-> ((0 3 1072))
(println end-pos)
;-> ((0 3 4973))
Code: Select all
(set 'start-pos (ref '(h2 "4. Functions in alphabetical order") xml-source))
(set 'end-pos (ref '(a ((name "appendix") (id "appendix"))) xml-source ))
(for (x (last start-pos) (last end-pos))
(push (xml-source (extend (chop start-pos) (list x))) res -1))
Code: Select all
start-pos ;=> (0 3 1072)
end-pos ;=> (0 3 4973)
(set 'start (last start-pos))
(set 'size (- (last end-pos) (last start-pos)))
(start size (xml-source (chop start-pos)))