Re: [xsl] xsl:number on attribute nodes..

Subject: Re: [xsl] xsl:number on attribute nodes..
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 9 Aug 2005 16:57:58 +0100
For once, i think i'd go with xalan here.
(two counts of 1, not one of 11, presumably on a document with one
element node with one attribute?)

You have a count attribute and an (implied) level="single"
so the system should start by going


   "goes up to the first node in the ancestor-or-self axis that matches
   the count pattern"

which in this case will give the element holding the attribute, and
count that.

Note I think the xslt1 spec is badly worded in this case if you use
level="multiple" as it says "followed by the element itself;" implying
that the current node is an element.


Note saxon8 handles your stylesheet differently, running your posted
code on itself produces:


$ saxon num.xsl num.xsl
Error at xsl:number on line 9 of file:/c:/tmp/num.xsl:
  Attribute nodes cannot be numbered
Transformation failed: Run-time errors were reported


$ saxon8 num.xsl num.xsl
Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
<?xml version="1.0" encoding="UTF-8"?>1111112111



David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread