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

Re: sequential numbering in xslt

Subject: Re: sequential numbering in xslt
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 4 Jan 2010 17:32:16 GMT
Re:  sequential numbering in xslt
> Also, position() does not increment is that correct? Will it not be
> always 1?

if you are processing a sequence of items then position() returns the
number of the item in the current sequence.

Ken's suggestion was that if (as is usually the case) you are starting
with a sequence of documents, then position() will return the number of
the current document.

>  I use saxon to read a directory of files,

if you mean using the built in "all files in a directory" feature, then
(I think) essentially you are running a separate transform on each input
with no connection between them, so instead use the collection()
function (perhaps with one of the saxon-specific query uri forms to refer
to all the xml files in the directory) then iterate over the collection
with
<xsl:for-each select="collection(.......)">
this is document: <xsl:value-of select="position()"/>



> failed because of the xsl:variable limitations.
Declarative programming languages in which variables hold values (rather
than memory locations) have the same expressive power as imperative
languages, so it's misleading to call this a limitation.

David

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.