X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Ftest.ml;h=b8f2be8c224b13957cc95d8e718e77f7deda833c;hp=770d4c52e84ec9d0d962ddb05a6c28e8c9a94290;hb=c951f1d4b8f4264acb0b5910dc544ad3a6ceebab;hpb=cba2938d929fd5119b1491686ddc224d5af618c6 diff --git a/src/test.ml b/src/test.ml index 770d4c5..b8f2be8 100644 --- a/src/test.ml +++ b/src/test.ml @@ -14,7 +14,13 @@ (***********************************************************************) +(** use: xml_file "XPath querie" + or : xml_file -f XPath_querie_file + only the first line of XPath_querie_file is read +*) + module F = Formula +module A = Ata (* to force ocaml build to add Formula to the dependency chain even if we don't use it yet*) @@ -25,7 +31,13 @@ let doc = -let query = XPath.parse Sys.argv.(2) +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 open Format