Bug #5341
closed
IndexOutOfRangeException:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Files
Transformation throws IndexOutOfBound exception, when 2 Unicode blue diamonds are present. When these 2 chars are not present, trasnformation finishes successfully.
We are using SaxonCS 11.1.
Chars are at rows 113 and 119.
Document is in Czech language.
using System;
using Saxon.Api;
using System.IO;
using System.Globalization;
namespace TestSaxonCS
{
class Program
{
static string xslt = @"
<xsl:stylesheet
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='3.0'>
<xsl:template match = '/'>
<xsl:sequence select = ""substring-after(/eventItem/contentMeta/scheduled/start, 'T')""/>
</xsl:template>
</xsl:stylesheet>";
static void Main(string[] args)
{
Processor processor = new Processor(true);
XsltCompiler xsltCompiler = processor.NewXsltCompiler();
xsltCompiler.XsltLanguageVersion = "3.0";
var rdr = new StringReader(xslt);
XsltExecutable exec = xsltCompiler.Compile(rdr);
Xslt30Transformer transf = exec.Load30();
XdmDestination dest = new XdmDestination();
var stream = File.OpenRead("cirkev.xml");
transf.ApplyTemplates(stream, dest);
}
}
}
- Category set to Internals
- Status changed from New to In Progress
- Assignee set to Michael Kay
- Priority changed from Low to Normal
Thanks for reporting it. I have reproduced the problem.
Confirmed that the failure also occurs with SaxonJ.
In Slice24.indexOf(), line 61,
return (i - start)/3;
should read
return i/3 - start;
because i is a byte offset into the array-of-24-bit-codepoints, while start is a code point offset.
So the problem affects string indexing operations on Unicode strings held as 24-bits per character.
Rather surprising that none of our tests hit this one.
- Status changed from In Progress to Resolved
- Applies to branch 11, trunk added
- Fix Committed on Branch 11, trunk added
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 11.3 added
Bug fix applied in the Saxon 11.3 maintenance release.
Please register to edit this issue
Also available in: Atom
PDF