X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Ftest.ml;h=dec8918dc92cead215150e361dbcc1137a82035a;hb=9c0b145d050a5981010435f54848dc862782709c;hp=b8f2be8c224b13957cc95d8e718e77f7deda833c;hpb=e2dcfc3066d33b814d4e9724563cc5b3e696060d;p=tatoo.git diff --git a/src/test.ml b/src/test.ml index b8f2be8..dec8918 100644 --- a/src/test.ml +++ b/src/test.ml @@ -13,6 +13,9 @@ (* *) (***********************************************************************) +(* + Time-stamp: +*) (** use: xml_file "XPath querie" or : xml_file -f XPath_querie_file @@ -30,19 +33,14 @@ let doc = close_in fd; d - -let query = +let query = let arg2 = Sys.argv.(2) in - if arg2 = "-f" - then let fq = open_in Sys.argv.(3) in - let q = XPath.parse_file fq in - close_in fq; q - else XPath.parse_string arg2 + XPath.Parser.parse (Ulexing.from_latin1_string arg2) open Format let () = - fprintf err_formatter "Query: %a\n%!" XPath.Ast.print query; + fprintf err_formatter "Query: %a\n%!" XPath.Ast.print_path query; fprintf err_formatter "Document:\n%!"; Tree.print_xml stderr doc (Tree.root doc); exit 0