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

Re: How do I do this?

Subject: Re: How do I do this?
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 21 Aug 2002 18:08:21 -0600 (MDT)
what does mike brown do
David N Bertoni/Cambridge/IBM wrote:
> > 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?
> 
> The format attribute is an AVT, so you need {{1}} to get {1}.

Ah, it is an AVT. I missed this because it wasn't explicitly stated as such,
except in the summary where it says
  format = { string }
(the curly braces indicating it is an AVT).

So, then, it is a bug that with format="{{1}}", Saxon will produce "0" when
the generated number is 0, but will wrap any other number in curly braces?

> > And why is <xsl:number/> treated differently
> > than <xsl:number value="position()"/> 
> [...] 
> You're right, it does seem vague, or least it's mixing terminology.  I've
> always interpreted this as the position in the document (as in document
> order).  Does that make sense?

Not really, because I still think of position as being relative to something.  
Its position "in the document" makes me think it's relative to something like 
the document-ordered set //node() or even 
( //node() | //node()/@* |  //node()/namespace::* ). I think it is relative
to something, but that something is dependent upon level, count, and from,
which haven't been explained yet.

Even Mike Kay's book (1st edition) doesn't really help much in this regard.

> Perhaps a more explicit and long-winded description would be better?

Well, I'd just rather see the terminology, especially w.r.t. "position", be
more accurate, and more examples provided. I mean, you gotta admit, that 2nd
paragraph under 'Number to String Conversion Attributes' is a doozie, and
there aren't enough examples.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.