[Bug 3326] Ambiguity regarding non-alphanumeric format tokens, xsl:number


------- Comment #1 from mike@saxonica.com  2006-06-12 22:16 -------
I agree, there's a gap here.

XSLT 1.0 said: "If the first token is a non-alphanumeric token, then the
constructed string will start with that token; if the last token is
non-alphanumeric token, then the constructed string will end with that token."
Saxon took that literally, so that <xsl:number value="99" format="()"/> gives
you "()99()"; and I've retained that interpretation in the 2.0 processor,
though there's nothing in the 2.0 spec to justify it (as you say, it's not
exactly useful to anyone, which is probably why no-one has complained).

I don't favour making this an error. It's a bit arbitrary, but I think my
preferred option would be to say that if there's only one token and it's
alphanumeric then we treat it as the prefix.

Regarding the "aside", I think that the only possible interpretation of the
spec is that an empty sequence is formatted as the concatenation of the prefix
and the suffix. I don't think we need to treat this as a special case, since it
falls out from the general rules.

Received on Monday, 12 June 2006 22:16:57 UTC