Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

Language RXML

Date:04/20/05
Author:Tomas
URL:n/a
Comments:1
Info:n/a
Score: (3.02 in 97 votes)
This version of 99 bottles is written in RXML, a markup language used
by the Roxen webserver, found at www.roxen.com. 

<comment>
99 bottles of beer on the wall in RXML
Written by Tomas Berndtsson <tomas@nocrew.org>
Tested in Roxen WebServer 2.1. 
</comment>

<set variable="var.pl" value="s"/>
<for variable="var.i" from="99" to="1">
 &var.i; bottle&var.pl; of beer on the wall,<br>
 &var.i; bottle&var.pl; of beer.<br>
 Take one down and pass it around,<br>
 <set variable="var.j" expr="&var.i; - 1"/>
 <if variable="var.j = 1"><set variable="var.pl" value=""/></if>
 <else><set variable="var.pl" value="s"/></else>
 <if variable="var.j = 0">No more</if>
 <else>&var.j;</else>
  bottle&var.pl; of beer on the wall.<p>
</for>


Greetings,

Tomas

Download Source | Write Comment

Alternative Versions

Comments

>>  frank said on 07/24/06 11:51:57

frank nice, but not working.

this will work:

<set variable="var.pl" value="s"/>
<for variable="var.i" from="99" to="1">
&var.i; bottle&var.pl; of beer on the wall,<br/>
&var.i; bottle&var.pl; of beer.<br/>
Take one down and pass it around,<br/>
<set variable="var.j" expr="&var.i; - 1"/>
<if variable="var.j = 1"><set variable="var.pl" value=""/></if>
<else><set variable="var.pl" value="s"/></else>
<if variable="var.j = 0">No more</if>
<else>&var.j;</else>
bottle&var.pl; of beer on the wall.<p/>
</for>

Download Source | Write Comment

Add Comment

Please provide a value for the fields Name, Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.

Please don't post large portions of code here! Use the form to submit new examples or updates instead!

Name:

eMail:

URL:

Security Code:
  
Comment: