[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Confusing trace from Saxon HE9


Subject: Re: [xsl] Confusing trace from Saxon HE9
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 08 Dec 2009 16:04:17 -0500

At 2009-12-08 20:58 +0100, Jeroen Hellingman wrote:
I am working with a rather complex stylesheet to split a TEI document into pieces for an epub file, and get the following trace on an error.

Error on line 204 of splitter.xsl:
XPTY0004: A sequence of more than one item is not allowed as the first argument of
generate-id() (<p/>, <p/>)

Looks pretty straightforward to me: generate-id() takes at most a single node as the argument and you've supplied two paragraph element nodes. Sure enough you have generate-id($node) and I suspect you'll find you have two paragraph elements in that variable.


Can you give me a hint on how to interpret this trace, as I do not understand how a

<xsl:call-template name="content.div1"/>

brings me into a template

<xsl:template name="filename.div0fragment">

Your stylesheet doesn't compile standalone because of missing template rules, which indicates to me there are other fragments at play.


Furthermore, the failing template receives two nodes in a variable that I hardly expect to be grouped together. In the source document they are not even siblings.

They don't have to be siblings to have been selected into the group. Any address can create multiple nodes.


The full stylesheet in question is here:
http://code.google.com/p/tei2html/source/browse/trunk/splitter.xsl

Nope:


Error at xsl:call-template on line 248 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id
Error at xsl:call-template on line 250 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id-for
Error at xsl:call-template on line 267 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id
Error at xsl:call-template on line 282 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id-for
Error at xsl:call-template on line 292 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id
Error at xsl:call-template on line 312 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-html-header
Error at xsl:call-template on line 318 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id-attribute-for
Error at xsl:call-template on line 321 of file:/T:/ftemp/jeroen.xsl:
  No template exists named GenerateLabel
Error at xsl:call-template on line 329 of file:/T:/ftemp/jeroen.xsl:
  No template exists named insert-footnotes
Error at xsl:call-template on line 351 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-html-header
Error at xsl:call-template on line 366 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id
Error at xsl:call-template on line 373 of file:/T:/ftemp/jeroen.xsl:
  No template exists named generate-id-for

So anything could be going on.

Expose your $node variable after you assign it and see where it gets more than one node in it.

I hope this helps.

. . . . . . Ken

--
XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19
Vote for your XML training:   http://www.CraneSoftwrights.com/s/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


Current Thread
Keywords