[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xsl:number on attribute nodes..

Subject: Re: xsl:number on attribute nodes..
From: Jack Matheson <jack@xxxxxxxxxxxxxx>
Date: Tue, 9 Aug 2005 11:18:56 -0500
jack matheson
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,

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


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

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.