[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: 1.57.0 - Numbereditem starts at 2?
On Fri, Nov 22, 2002 at 01:03:15PM -0500, Andy Jewell wrote: > Hi, all. . . I just started running my documents through the XSL-1.57 > style sheets and really like the new updates. I'm seeing one new > anomaly that I didn't get in 1.53. I generate PDFs with FOP-.24 and > with this XML: > > <?xml version="1.0" encoding="iso-8859-1"?> > <sect1> > <title>Sample title</title> > <para>Sample paragraph below the sample title.</para> > <orderedlist> > <listitem><para>Item 1</para></listitem> > <listitem><para>Item 2</para></listitem> > </orderedlist> > </sect1> > > I get this output: > Sample title > Sample paragraph below the sample title. > 2. Item 1 > 3. Item 2 > > Does anyone else get the same? Or possibly I'm doing something wrong > that 1.53 didn't care about but 1.57 does? Any help would be > appreciated! This was a very interesting problem. The 1.57.0 stylesheets have more sophisticated numbering options, so you hit new code. When I tested your sample with xsltproc, the listitems were numbered 1 and 2. When I tested your sample with Saxon, they were numbered 2 and 3. Strange. If you add a proper DOCTYPE declaration to your sample file to reference the DocBook DTD,, then Saxon also produces 1 and 2. The issue seems to be how the following line at the beginning of the template named 'orderedlist-starting-number' in common/common.xsl: <xsl:when test="$list/@continuation != 'continues'">1</xsl:when> In the DTD, the 'continuation' attribute for orderedlist has a default value of 'restarts'. That's why it works with the DTD, because this test is satisfied. That is, 'restarts' != 'continuation' is true. Without the DTD, and without a 'continuation' attribute on orderedlist, is this test true or false? I believe that "does not exist" is not equal to 'continues', so the test must be true. Why does saxon think it is false and use the xsl:otherwise clause that starts the list at 2? I tried this with both the Alfred parser and the Xerces parser in Saxon, with the same result. Michael Kay's XSLT Reference has a table of what != means for different operands. For a nodeset (the attribute node) and a string, he says: "True if the node-set contains a node whose string-value is not equal to the string operand". But we have an empty node-set. So that makes the expression false? Curious. -- Bob Stayton 400 Encinal Street Publications Architect Santa Cruz, CA 95060 Technical Publications voice: (831) 427-7796 The SCO Group fax: (831) 429-1887 email: bobs@sco.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC