From: <wol...@us...> - 2006-09-30 21:02:00
|
Revision: 4456 http://svn.sourceforge.net/exist/?rev=4456&view=rev Author: wolfgang_m Date: 2006-09-30 14:01:53 -0700 (Sat, 30 Sep 2006) Log Message: ----------- Expand predefined entities when comparing text. Modified Paths: -------------- trunk/eXist-1.0/webapp/xqts/xqts.xql Modified: trunk/eXist-1.0/webapp/xqts/xqts.xql =================================================================== --- trunk/eXist-1.0/webapp/xqts/xqts.xql 2006-09-30 21:00:39 UTC (rev 4455) +++ trunk/eXist-1.0/webapp/xqts/xqts.xql 2006-09-30 21:01:53 UTC (rev 4456) @@ -146,6 +146,11 @@ replace(replace($str, "^\s+", ""), "\s+$", "") }; +declare function xqts:normalize-and-expand($text as item()*) as xs:string { + replace(replace(replace(xqts:normalize-text($text), "&amp;", "&", "m"), "&lt;", "<"), + "&gt;", ">") +}; + declare function xqts:check-output($query as xs:string, $result as item()*, $case as element(catalog:test-case)) { let $output := $case/catalog:output-file[last()] return @@ -159,7 +164,7 @@ else if ($output/@compare eq "Text") then let $text := util:file-read(concat($xqts:XQTS_HOME, "ExpectedTestResults/", $case/@FilePath, "/", $output/text()), "UTF-8") - let $test := xqts:normalize-text($text) eq xqts:normalize-text($result) + let $test := xqts:normalize-and-expand($text) eq xqts:normalize-text($result) return xqts:print-result($case/@name, $test, $query, $result, $text, $case) (: Comparison method: "XML" :) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |