#!/usr/bin/ocamlrun /usr/bin/ocaml
+(* Copyright (C) 2006, HELM Team.
+ *
+ * This file is part of HELM, an Hypertextual, Electronic
+ * Library of Mathematics, developed at the Computer Science
+ * Department, University of Bologna, Italy.
+ *
+ * HELM is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * HELM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HELM; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA 02111-1307, USA.
+ *
+ * For details, see the HELM World-Wide-Web page,
+ * http://helm.cs.unibo.it/
+ *)
let fname =
try Sys.argv.(1)
with Not_found -> ())
toc
-(* let a_s = Pxp_document.find_all ~deeply:true (match_elt "a" "href" ()) toc in
- List.iter
- (fun (node: 'a node) ->
- let href = node#required_string_attribute "href" in
- assert (String.length href > 0);
- if href.[0] = '#' then
- let xref = String.sub href 1 (String.length href - 1) in
- if List.mem xref sec_ids then
- node#set_attribute "href" (Pxp_types.Value (fname_of_sec xref))
- else
- try
- let sec = Hashtbl.find id2sec xref in
- node#set_attribute "href"
- (Pxp_types.Value (fname_of_sec sec ^ "#" ^ xref))
- with Not_found -> ())
- a_s *)
-
let patch_sec sec_ids id2sec sec =
let sec_name = get_sec_name sec in
iter_xrefs