xsl-list
[Top] [All Lists]

Re: xsl:number on attribute nodes..

2005-08-09 09:18:56
Your presumption was correct. The input document responsible for those results was:

<empty a="1"/>

I also noticed that Saxon8 produces no error, but I am only concerned with XSLT 1.0 at this point. I'm not familiar with XSLT 2.0 at all...is there something in that spec which clarifies this issue and hopefully explains the output
difference in the two versions of Saxon?

Thanks for the speedy reply,
-Jack


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
______________________________________________________________________ __

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>