From: Wolfgang M. <wol...@gm...> - 2006-02-23 12:33:15
|
Hi, > declare option exist:serialize "highlight-matches=3Dnone"; > declare namespace x=3D"http://www.tbrc.org/models/changed#"; > declare namespace z=3D"http://www.tbrc.org/models/work#"; > > for $i in collection("/db/tbrc/tbrc-works")/z:work[z:title &=3D "bon" an= d not(z:title &=3D "sa bon")] > let $b :=3D concat(data($i/@RID), ".xml"), > $outputOpts :=3D ("encoding=3DUTF-8", "indent=3Dyes") > return > util:serialize($i, concat("/usr/local/migration-data/bon/works/",= $b), $outputOpts) You are using util:serialize to write out the result. util:serialize does NOT inherit the serialization options of the XQuery it is called from. Instead, you have to pass the serialization paramter via the $outputOpts. So $outputOpts :=3D ("highlight-matches=3Dnone", "encoding=3DUTF-8", "indent= =3Dyes") should give you what you want, at least in theory ;-) In practice, just encoding and indent are respected, while highlight-matches is ignored. To fix this, add the following after line 108 in org.exist.xquery.functions.util.Serialize: serializer.setProperties(outputProperties); (the line should be added AFTER serializer.reset()) Wolfgang< |