X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tree.ml;h=8ebcdccfdb58bd6b63b04eba96824d2cf61c39a6;hb=95367aa932a9e179976e59ea326542c50905f5b3;hp=c3a225545a56fafd9bae7294cf1ef68e6b07fa11;hpb=b821684aac2e3114c2eb28188020d7a09b5de2a5;p=SXSI%2Fxpathcomp.git diff --git a/tree.ml b/tree.ml index c3a2255..8ebcdcc 100644 --- a/tree.ml +++ b/tree.ml @@ -453,7 +453,11 @@ module DEBUGTREE | Node (SC (_,ns)) -> norm ns | Node(NC t) -> let ns = next_sibling_ n.doc t in - let txt = next_text_ n.doc t in + let txt = + if XML.Tree.is_nil ns then + next_text_ n.doc t + else prev_text_ n.doc ns + in if is_empty_ n.doc txt then norm ns else Node (SC (txt, ns)) @@ -466,7 +470,6 @@ module DEBUGTREE | { doc=d; node=Node(SC (i,_) )} -> text_xml_id_ d i | _ -> failwith "id" - (* Wrapper around critical function *) let string t = time ("TextCollection.GetText()") (string) t let left = first_child @@ -558,4 +561,3 @@ module DEBUGTREE end module Binary = DEBUGTREE -