Re: [xsl] How do I do this?

Subject: Re: [xsl] How do I do this?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 21 Aug 2002 17:44:38 -0400
Mike,

At 04:40 PM 8/21/2002, you wrote:

Oh yeah, xsl:number :) But I think he wants numbering to start at zero.

Oops.


By the way, why does adding format="{{1}}" produce the number enclosed in
single curly braces unless the number is 0, while format="{1}" seems to be no
different than format="1"? format="[1]" works as expected, so what rule in the
spec am I overlooking?

If it's construed as an attribute value template, format="{1}" would indeed evaluate as format="1". When I tried it with {1} to see whether it was an AVT, I just forgot to try {{1}} (good catch). Presumably it's an AVT so you can make the number format dynamic.


And why is <xsl:number/> treated differently
than <xsl:number value="position()"/> (at least with Saxon)?
I thought value="position()" was the default.

No, I don't think value has a default.


The spec says "If no value attribute is specified, xsl:number determines a
sequence number based on the position of the curent node in the source
document", which I think is rather ambiguous since a current node has no
position except with respect to the current node list. XSLT 2.0 currently says
"...based on the position of the context node within its containing document"
which is no more helpful.

I agree, rather. Apparently the word "position" is used in its English language sense, not its technical sense. Perhaps they could say "based on where it is in its containing document" which seems to be vaguer, but isn't, and doesn't run the risk of saying what they don't want to say by invoking the technical sense. :->


Oh well.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread