Hello, everyone:
 
I'm using Saxon's XQuery in order to generate an SVG document
with a 'checkerboard' pattern and I got the above-mentioned error
on a Windows XP machine.  Although I'm doing this for fun, this
looks like a potential bug, so here I am (again)....
 
Cordially,
 
Oswald
 
 
The contents of checkerboard1.xq:
--------------------------------------------------
xquery version "1.0"
declare namespace math="java:java.lang.Math"
<svg>
<g>
{
  let $basePointX    := doc("checkerBoard1.xml")/svgData/basePointX
  let $basePointY    := doc("checkerBoard1.xml")/svgData/basePointY
  let $rowCount      := doc("checkerBoard1.xml")/svgData/rowCount
  let $colCount      := doc("checkerBoard1.xml")/svgData/colCount
  let $cellWidth     := doc("checkerBoard1.xml")/svgData/cellWidth
  let $cellHeight    := doc("checkerBoard1.xml")/svgData/cellHeight
  let $interCellHGap := doc("checkerBoard1.xml")/svgData/interCellHGap
  let $interCellVGap := doc("checkerBoard1.xml")/svgData/interCellVGap
 return (
  for $row in 0 to $rowCount
  for $col in 0 to $colCount
    let $xCoord := $row*($interCellHGap+$cellWidth),
        $yCoord := $row*($cellHeight+$interCellVGap),
        $index  := ($row + $col) mod 2,
        $style  := doc("checkerBoard1.xml")/svgData/styles/style[position()=$index]/@type
  return
    <rect x="{$basePointX + $xCoord}"
          y="{$basePointY + $yCoord}"
          width="{$cellWidth}"
          height="{$cellHeight}"
          style="{$style}">
    </rect>
 )
}
</g>
</svg>
The contents of checkerboard1.xml:
----------------------------------------------------
<?xml version="1.0"?>
<svgData>
  <basePointX>40</basePointX>
  <basePointY>40</basePointY>
  <rowCount>8</rowCount>
  <colCount>10</colCount>
  <cellWidth>30</cellWidth>
  <cellHeight>30</cellHeight>
  <interCellHGap>2</interCellHGap>
  <interCellVGap>2</interCellVGap>
  <styles>
    <style type="fill:red;"/>
    <style type="fill:blue;"/>
  </styles>
</svgData>
 
The stack trace:
-----------------------
java.lang.NullPointerException
 at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:182)
 at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:110)
 at net.sf.saxon.expr.ArithmeticExpression.evaluateItem(ArithmeticExpression.java:236)
 at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:119)
 at net.sf.saxon.expr.ComputedExpression.iterate(ComputedExpression.java:317)
 at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:110)
 at net.sf.saxon.expr.ComputedExpression.evaluateAsString(ComputedExpression.java:295)
 at net.sf.saxon.instruct.SimpleNodeConstructor.expandChildren(SimpleNodeConstructor.java:88)
 at net.sf.saxon.instruct.Attribute.processLeavingTail(Attribute.java:176)
 at net.sf.saxon.instruct.Instruction.process(Instruction.java:151)
 at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:193)
 at net.sf.saxon.instruct.Element.evaluateItem(Element.java:277)
 at net.sf.saxon.instruct.ExprInstruction.iterate(ExprInstruction.java:128)
 at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:25)
 at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:25)
 at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:25)
 at net.sf.saxon.expr.ForExpression$MappingAction.map(ForExpression.java:141)
 at net.sf.saxon.expr.MappingIterator.advance(MappingIterator.java:67)
 at net.sf.saxon.expr.MappingIterator.hasNext(MappingIterator.java:95)
 at net.sf.saxon.expr.MappingIterator.advance(MappingIterator.java:79)
 at net.sf.saxon.expr.MappingIterator.hasNext(MappingIterator.java:95)
 at net.sf.saxon.instruct.Sequence.processLeavingTail(Sequence.java:133)
 at net.sf.saxon.instruct.Instruction.process(Instruction.java:151)
 at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:193)
 at net.sf.saxon.instruct.Element.processLeavingTail(Element.java:174)
 at net.sf.saxon.instruct.Instruction.process(Instruction.java:151)
 at net.sf.saxon.instruct.Instruction.processChildren(Instruction.java:193)
 at net.sf.saxon.instruct.Element.evaluateItem(Element.java:277)
 at net.sf.saxon.instruct.ExprInstruction.iterate(ExprInstruction.java:128)
 at net.sf.saxon.query.XQueryExpression.iterator(XQueryExpression.java:144)
 at net.sf.saxon.Query.doMain(Query.java:313)
 at net.sf.saxon.Query.main(Query.java:64)
Fatal error during transformation: null
 
 


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software