val domImpl = Gdome.domImplementation ()
(** process an XSLT stylesheet *)
- method private process uri =
- Gdome_xslt.processStylesheet (domImpl#createDocumentFromURI ~uri ())
+ method private process uri = domImpl#createDocumentFromURI ~uri ()
method get keys =
self#doReader (lazy (
- List.fold_left
- (fun collected_styles key ->
- (List.find (fun (k, _) -> k = key) stylesheets)::collected_styles)
- []
- (List.rev keys)
+ let rev_keys = List.rev keys in
+ let last_key = List.hd rev_keys in
+ let p_stylesheets =
+ List.fold_left
+ (fun collected_styles key ->
+ let (key, stylesheet) =
+ try
+ List.find (fun (k, _) -> k = key) stylesheets
+ with Not_found -> raise (Stylesheet_not_found key)
+ in
+ (key, Gdome_xslt.processStylesheet stylesheet)::collected_styles)
+ []
+ rev_keys
+ in
+ let last_stylesheet =
+ snd (List.find (fun (k, _) -> k = last_key) stylesheets)
+ in
+ (p_stylesheets, last_stylesheet)
))
method add key uri =