Re: [xsl] xml to svg graphs

Subject: Re: [xsl] xml to svg graphs
From: "Dave Pawson dave.pawson@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Jan 2026 08:11:53 -0000
On Thu, 29 Jan 2026 at 23:31, Liam R. E. Quin liam@xxxxxxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> On Thu, 29 Jan 2026 14:18:47 -0000
> "Dave Pawson dave.pawson@xxxxxxxxx"
> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >  <xsl:variable name="maxYLabelWd" select="$labelFontSize *
> > $labelFontWd * max(for $a in (0 to $yAxisMarkCount) return
> > string-length(
> > if ($gra/ph/@stacked='percentage') then
> > concat(m:Round(($yAxisMin + $a * $yAxisStep) * 100, $yAxisStep), '% ')
> > else
> > string(m:Round($yAxisMin + $a * $yAxisStep, $yAxisStep))
> > )
> > + (if ($gra/ph/@yAxisType='log') then 2 else 0)
> > )"/>
> >
> > with (saxon 9) error
> > Error on line 132 of msgr2svg.xsl:
> >   XPTY0004: Required item type of second operand of 'to' is
> > xs:integer; supplied value has
> >   item type xs:double
>
> Either declare yAxisMarkCoiunt as an integer or turn it into an integer.
>
> To make it an integer add as="xs:integer" on the cal:variable element
> defining it.
> To convert it, use xs:integer($yAxisMarkCount) or $yAxisMarkCount cast
> as xs:integer.
>
> liam
>



Thanks Liam. The errors just ripple up the stylesheet.
A classic case of Mikes advice on using data types!
msgr2svg.xsl  fails in xslt 2.0 with most of the examples.
  It needs some serious typing attention.
regards











>
> --
> Liam Quin: Delightful Computing - Training and Consultancy in
> XSLT / XML Markup / Typography / CSS / Accessibility / and more...
> Outreach for the GNU Image Manipulation Program
> Vintage art digital files - fromoldbooks.org
> 
>
>

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.

Current Thread