Project

Profile

Help

Exception during execution in Saxon-HE-9.5.1-6

Added by Vladimir Nesterovsky over 4 years ago

A while ago I already reported a problem "Saxon Exception during execution in Saxon-HE-9.5.1-2". Now I got similar exception in Saxon-HE-9.5.1-6.

Please consider the code:

<xsl:message select="t:string-join($items)"/>

/xsl:template

<!-- Joins adjacent string items. $items - item to join. -->

<xsl:variable name="indices" as="xs:integer*" select="
  0,
  index-of
  (
    (
      for $item in $items return
        $item instance of xs:string
    ),
    false()
  ),
  count($items) + 1"/>

<xsl:sequence select="
  for $i in 1 to count($indices) - 1 return
  (
    $items[$indices[$i]],
    string-join
    (
      subsequence
      (
        $items,
        $indices[$i] + 1,
        $indices[$i + 1] - $indices[$i] - 1
      ),
      ''
    )
  )"/>

/xsl:function

/xsl:stylesheet

The output is:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at net.sf.saxon.om.Chain.itemAt(Chain.java:161) at net.sf.saxon.om.SequenceTool.itemAt(SequenceTool.java:130) at net.sf.saxon.expr.FilterExpression.iterate(FilterExpression.java:1143) at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:365) at net.sf.saxon.expr.instruct.BlockIterator.next(BlockIterator.java:49) at net.sf.saxon.expr.MappingIterator.next(MappingIterator.java:70) at net.sf.saxon.expr.instruct.Message.processLeavingTail(Message.java:264) at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660) at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:239) at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1057) at net.sf.saxon.Controller.transformDocument(Controller.java:2088) at net.sf.saxon.Controller.transform(Controller.java:1911) ...


Replies (3)

Please register to reply

RE: Exception during execution in Saxon-HE-9.5.1-6 - Added by Vladimir Nesterovsky over 4 years ago

Another question (it might be worth to open a separate thread).

In latest releases you build saxon9he.jar without any compression. E.g. in the latest download its size ~10MB. If I just recompress it, its size goes down to <4MB.

Is there a reason in such packaging?

Please note that compressed jar might load a little bit faster, as it takes less I/O to map it into a memory.

RE: Exception during execution in Saxon-HE-9.5.1-6 - Added by O'Neil Delpratt over 4 years ago

Hi Vldaimir, I think it best for you to look at a similar thread where a user asked about compressed version of the Saxon-HE jar file: #1897 (https://saxonica.plan.io/issues/1897)

Initially Mike responded as follows in comment 1:

@"Thanks for reporting it. The decision not to compress the JAR file was a deliberate one made many years ago in response to advice that this would improve start-up/loading time, which for typical Saxon use cases is more important than the speed of downloading the software from the network. We will review the decision to see whether this trade-off is still correct, or whether the reasoning is now different. Perhaps the fact that many people now download repeatedly using Maven makes a difference."@

As discussed further down in the thread we later decide to issue a compressed version of the Saxon-HE jar file on maven (see: https://saxonica.plan.io/issues/1897#note-13). i.e. Saxon-HE-9.5.1-6-compressed.jar

    (1-3/3)

    Please register to reply