X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=xPath.ml;h=2ac43b76014dbb619772d7e1ac690868fe10d1bd;hb=cf6d366b25132eea7b0f1966c11d034d748af0fa;hp=bef0336a344f1c477ba75173173385fe4fde8a06;hpb=09870a49122b3d7048422818dbb0a038513b4d14;p=SXSI%2Fxpathcomp.git diff --git a/xPath.ml b/xPath.ml index bef0336..2ac43b7 100644 --- a/xPath.ml +++ b/xPath.ml @@ -153,10 +153,16 @@ step : [ | [ "." ; p = top_pred -> [(Self,TagSet.node,p)] ] | [ ".." ; p = top_pred -> [(Parent,TagSet.star,p)] ] | [ "contains"; "(" ; s = STRING ; ")";p=top_pred -> [ - let _ = contains := Some(s) in (Child,TagSet.singleton Tag.pcdata, p)] + let _ = contains := Some((`CONTAINS,s)) in (Child,TagSet.singleton Tag.pcdata, p)] ] -| [ "contains_full"; "(" ; s = STRING ; ")";p=top_pred -> [ - let _ = contains := Some(s) in (Descendant,TagSet.singleton Tag.pcdata, p)] +| [ "equals"; "(" ; s = STRING ; ")";p=top_pred -> [ + let _ = contains := Some((`EQUALS,s)) in (Child,TagSet.singleton Tag.pcdata, p)] + ] +| [ "startswith"; "(" ; s = STRING ; ")";p=top_pred -> [ + let _ = contains := Some((`STARTSWITH,s)) in (Child,TagSet.singleton Tag.pcdata, p)] + ] +| [ "endswith"; "(" ; s = STRING ; ")";p=top_pred -> [ + let _ = contains := Some((`ENDSWITH,s)) in (Child,TagSet.singleton Tag.pcdata, p)] ] | [ test = test; p = top_pred -> [(Child,test, p)] ] | [ att = ATT ; p = top_pred ->