I've confirmed that this is a bug. You can track progress on it at

https://saxonica.plan.io/issues/2081

Michael Kay
Saxonica

On 23 May 2014, at 09:14, Gunther Rademacher <grd@gmx.de> wrote:

The XQuery recommendation contains a section on end-of-line handling, and as I
understand it, it should make no difference whether a query contains Unix-style
or DOS-style line endings, because they are normalized to a single line feed before
processing.
 
For Saxon, this normalization appears to be done for the main query only, not for
modules. This may lead to different results, depending on whether a function or
variable is placed in the primary input vs. an XQuery module.
 
Here is a sample:
 
    main query:
 
        import module namespace x="X" at "x.xq";
        declare variable $x := <x>
        X</x>;
        <y>{$x, $x:x}</y>
 
    x.xq:
 
        module namespace x="X";
        declare variable $x:x := <x>
        X</x>;
 
   result, when using CR/LF line-endings in the above:
 
        <?xml version="1.0" encoding="UTF-8"?><y><x>
        X</x><x>&#xD;
        X</x></y>
 
The result has just LF line endings, with just one CR shown as an entity. I think that
module line endings should be normalized, too, which would make the CR disappear.
 
Tested with Saxon-HE 9.5.1.5J from command line.
 
Besr regards
Gunther
 
 
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help