You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Varadharajan Sethuraman <va...@yahoo.com> on 2004/04/27 15:17:24 UTC

iteration in xsl

Hi All,
 
I just want to know the iteration functionality in xsl.
 
for example similar to the following ...
for(int i=0;i<10;i++){
 
}
 
or how do i achieve that functionality ... is there any workaround?
kindly let me know ...
 
Regards
Varadharajan S
 

		
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs 

Re: iteration in xsl

Posted by Will Gilbert <gi...@informagen.com>.
> I just want to know the iteration functionality in xsl.
>  
> for example similar to the following ...
> for(int i=0;i<10;i++){
>  
> }


This can be done in XSLT but it involves invoking a template 
recursively and passing a counter which you decrement to zero or 
increment to a target.  The is a "for-each" keyword which help do 
counting stuff as well.

Here's some money well spend (IMHO)...

	"XSLT Cookbook" by Sal Mangano from the O'Reilly series, ISBN 
0-596-00372-2

Tons of useful techniques and code sample has save me many an wasted 
afternoon guessing.

Re: iteration in xsl

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Varadharajan Sethuraman wrote:
> I just want to know the *iteration functionality* in xsl.
> for example similar to the following ...
> *for(int i=0;i<10;i++){*

You most likely wont need it. Check your XSLT book (you
have a book, haven't you?) for the position() and count()
XPath functions.
If you decide to ask on the XSL list, state your original
problem, like "how do I get FO list items enumerated similar
to HTML <ol>?", rather than the derived one. This is more
likely to get you a sensible answer.

J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: RTF

Posted by Chris Bowditch <bo...@hotmail.com>.
Mauro Caon wrote:

> Hi,
> can anyone tell me APPROXIMATELY when RTF will be created whith FOP?

You can generate RTF from XSL-FO using JFOR.

http://www.jfor.org/

This has been integrated into the development version of FOP. However, we are 
a long way off being able to release the development version. You can download 
the development version from CVS Head. It is not production ready, so use at 
your own peril.

Chris



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: RTF

Posted by Peter Herweg <ph...@web.de>.
Hi,

unfortunatelly i have currently no time to work on jfor's integration into
fop. But anyway the current rtf support of the development version is nearly
as good as jfor (maybe in some points even better).

Kind regards
Peter Herweg

> -----Original Message-----
> From: fop-user-return-13557-pherweg=web.de@xml.apache.org
> [mailto:fop-user-return-13557-pherweg=web.de@xml.apache.org]On Behalf Of
> Mauro Caon
> Sent: Friday, April 30, 2004 9:07 AM
> To: fop-user@xml.apache.org
> Subject: RTF
>
>
> Hi,
> can anyone tell me APPROXIMATELY when RTF will be created whith FOP?
>
> Thanks
> Mauro
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RTF

Posted by Mauro Caon <ma...@studioinformatica.it>.
Hi,
can anyone tell me APPROXIMATELY when RTF will be created whith FOP?

Thanks
Mauro

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: iteration in xsl

Posted by Chris Bowditch <bo...@hotmail.com>.
Varadharajan Sethuraman wrote:

> Hi All,
>  
> I just want to know the *iteration functionality* in xsl.
>  
> for example similar to the following ...
> *for(int i=0;i<10;i++){*
> ** 
> *}*
>  
> or how do i achieve that functionality ... *is there any workaround?*
> kindly let me know ...

This is a pure XSL question, which would be answered more thoroughly on the 
xsl list:

http://www.mulberrytech.com/xsl/xsl-list/

You can use xsl:for-each to cycle through all nodes in a node set determined 
by the select attribute.

However, xsl is not a procedural lanaguage and as such you are often better 
off using a series of xsl:templates and xsl:apply-templates to achieve what 
you want.

Chris





---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: iteration in xsl

Posted by Joseph Kesselman <ke...@us.ibm.com>.



You might have wanted to ask this in the Xalan mailing lists, since Xalan
is Apache's XSLT processor... but an even better place to ask general XSL
usage questions would be in the XSL Users mailing list:
      http://www.mulberrytech.com/xsl/xsl-list/index.html

Even better: Dave Pawson is maintaining an excellent XSL FAQ based on that list
            http://www.dpawson.co.uk/xsl/index.html
which has advice on how to accomplish specific tasks in XSL, and I believe he did cover this question.

The brief answer is that XSLT does not have iteration per se, since all XSLT variables are
single-assignment.  (XSLT can be thought of as a non-procedural language.) There are some
moderately ugly ways to get similar results.

I believe XSLT 2.0 and XQuery are expected to make generating and iterating through a
sequence of numbers somewhat easier.

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org