Bug #5341
closedIndexOutOfRangeException:
100%
Files
Updated by Jiri Dolejsi almost 3 years ago
- File cirkev.xml cirkev.xml added
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);
}
}
}
Updated by Michael Kay almost 3 years ago
- 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.
Updated by Michael Kay almost 3 years ago
Confirmed that the failure also occurs with SaxonJ.
Updated by Michael Kay almost 3 years ago
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.
Updated by Michael Kay almost 3 years ago
- Status changed from In Progress to Resolved
- Applies to branch 11, trunk added
- Fix Committed on Branch 11, trunk added
Fix tested.
Updated by O'Neil Delpratt over 2 years ago
- 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