Add a command line option to disable the indexing of ignorable whitespaces.
[SXSI/xpathcomp.git] / src / tree.ml
index df72de7..2b8c1aa 100644 (file)
@@ -79,11 +79,13 @@ struct
   let do_text b t =
     if Buffer.length t > 0 then begin
       let s = Buffer.contents t in
-      begin
-       open_tag b "<$>";
-       text b s;
-       close_tag b "<$>";
-      end;
+      if (!Options.index_empty_texts) || not (is_whitespace s) then
+       begin
+         open_tag b "<$>";
+         Printf.eprintf "Inserting >>%s<<\n" s;
+         text b s;
+         close_tag b "<$>";
+       end;
       Buffer.clear t
     end