Bug #5700
closedtoo many namespaces leads to ArrayIndexOutOfBoundsException
100%
Description
with Saxon-HE 9.9.1.8J from Saxonica
if using too many namespace definitions, then an ArrayIndexOutOfBoundsException is thrown
to reproduce:
java -jar saxon9he.jar -s:too.xml -xsl:id.xslt &> error_output
refer to attached files below:
too.xml
id.xslt
error_output
Files
Updated by Michael Kay about 2 years ago
- Category set to Diagnostics
- Assignee set to Michael Kay
- Priority changed from Low to Normal
Thanks for providing the test case.
The limit for a TinyTree is 1024 namespace prefixes used in a single document. We increased the limit in Saxon 9.8, it was previously 1024 prefixes globally.
The limit is there for a good reason and I don't propose to change it. But I'll look at whether we can produce better diagnostics when the limit is exceeded.
There used to be an application (Apache Axis?) that generated XML documents with a ludicrous number of namespace bindings, but I haven't seen the problem for many years. It would be interesting to know whether this is a real requirement.
Updated by Michael Kay about 2 years ago
- Status changed from New to Resolved
- Applies to branch 10, 11, trunk added
- Applies to branch deleted (
9.9) - Fix Committed on Branch 10, 11, trunk added
- Platforms .NET, Java added
The limit is actually 2047 namespace prefixes per document.
I've patched it to fail with a slightly more informative exception.
Updated by Frederic Guilbeault about 2 years ago
Thanks for the prompt resolution. It is aligned with your expectations. There is no justifiable requirement for using so many (thousands) of namespace bindings. Applications that do this should be redesigned. If ever there is a justifiable requirements for this, I will inform you.
The focus here is more to improve the error, indeed, so that it is more informative. Thanks again for addressing this so promptly.
Updated by Community Admin almost 2 years ago
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.0 added
Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied
Updated by O'Neil Delpratt almost 2 years ago
- Fixed in Maintenance Release 11.5 added
Bug fix applied in the Saxon 11.5 maintenance release.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 10.9 added
Bug fix applied in the Saxon 10.9 maintenance release.
Please register to edit this issue