Previous Chapter
Next Chapter
Table of Contents
Index
RXML tags
<ACCESSED>
<ACONF>
<APRE>
<AUTOFORMAT>
<BOFH>
<CLIENTNAME>
<COMMENT>
<COUNTDOWN>
<DATE>
<DEFINE> & <INSERT>
<DOC>
<DTHOUGHT>
<FORMOUTPUT>
<GCLOCK>
<HEADER>
<IF>, <ELSE>
<LANGUAGE>
<PR>
<QUOTE>
<RANDOM>
<REFERRER>
<REMOVE_COOKIE>
<RETURN>
<SET_COOKIE>
<SIGNATURE>
<SMALLCAPS>
<SOURCE>
<TABLIFY>
<USER>
Time and date attributes
|
Roxen tags are used in the same way as normal HTML tags. Roxen allows
you to mix HTML and RXML tags in the same file. Before files
are sent, they are parsed by your Roxen's Main RXML parser.
The RXML tags are then translated into HTML
whereupon the file is sent out as a normal HTML-file.
Note that this parsing is not the same thing as server side includes
(SSI), although Roxen supports that too in order to facilitate an
upgrade from another server without having to upgrade your
pages immediately.
The following is a presentation of Roxen's RXML tags. RXML tags like
HTML tags, are always enclosed in angle-brackets (<>) and are
case-insensitive; that is, it doesn't matter whether you type them in
upper or lower case. Most tags have a starting and an ending tag
(<tag>..</tag> for example). Some tags,
however, do not request an ending tag, so called empty tags.
All tags are
presented in alphabetical order. Note that some tags
are only available when their corresponding modules are enabled. If
things don't work as you expect talk to your system administrator or
consult the administrator part of the manual.
The tags presented here are sufficient for most purposes, but if you
have specialized needs you can also write your own. Refer to the
chapter on How to make your own Roxen module for an introduction to this
topic. For easy reference you will find all the available tags in
Appendix A with references
to the page where the description
can be found. Look at the examples and play around with them to see
what they do.
This is a basic access counter. Instead of using a CGI-script, you
just insert <accessed>. To use this tag you have to
activate it in the RXML parser module.
Note that the accessed tag can be used
together with the gtext tag allowing you to do quite nifty access
counters, see the example section.
Attributes
- add[=how_much]
- Adds one or "how_much" to the number of accesses of the
file that is accessed, or, in the case of no file, the current document.
Notice that the add attribute adds how_much to
each time the page is accessed and not only
once which is the case with the cheat attribute.
- addreal
- If you use cheat or other modifiers
to the count, this attribute adds the correct count as comment
in the HTML code, like this: <!-- (4711) -->.
- capitalize
- Capitalizes the first letter of the string.
- cheat=num
- Adds num to the actual number of
accesses once. If your page for example has been accessed 56 times
and you add <accessed cheat=100> the result will
be 156 times the first time you access the page, 157 the second
and so on.
- factor=mult_factor
- Multiplies the actual number of
accesses by mult_factor and divides the result by one hundred.
- file=filename
- Shows the number of times the file
filename has been accessed instead of how many times
the current page has been accessed. If filename does
not begin with "/", it is assumed to be a URL relative
to the directory containing the file in which the
<accessed> tag was found. Note that you have
to type in the full name of the file. If there is a file named
tmp/, you cannot shorten the name to
tmp/, even if you've set Roxen up to use
as a default page.
|
|
One limitation is that you cannot reference a file that does not
have its own <accessed> tag. It suffices to
enter this in a comment in the file, i.e. you do not need to
display it in everyone of these files:
<!-- <accessed> -->
This is done for reasons of efficiency, since it would be very
costly to automatically log accesses for all files. It is however
possible to configure the Main RXML Parser to access count files
ending with certain extensions.
- lang=language
- When using type=string, the
number string is replaced by the string in the language indicated
by this attribute. This also affects the since and
part attributes. Available languages are Catala (ca or
es_CA), Croatian (hr), Dutch (du), English (en, default), Finnish
(fi), French (fr)
German (de), Japanese (jp),
Italian (it), Maori (mi), Norwegian (no), Russian (ru), Serbian (sr),
Slovenian (si), Spanish (es),Swedish (se) Portuguese (pt).
- lower
- Lowercases the string.
- per=second|minute|hour|day|week|month
- Shows the number of accesses per unit of time.
- prec(precision)=number
- Rounds the number of accesses. The result is an integer with
number valid digits. If prec=2, show
12000 instead of
12149.
- reset
- Resets the access counter. Only do this
under special conditions, i.e. within an
<if>...</if>.
- silent
- Do not show the count.
- since
- Inserts the date that the accessed number is
counted from. The language will depend on the lang tag, default
is English.
In the example below the cheat attribute adds 90 to the actual
number of accesses, while the addreal gives you
information about the actual number of accesses. |
|
Note that the "addreal"
information only can be seen in the HTML-code.
|
This page has been accessed<accessed type=string cheat=90
addreal> times since<accessed since>.
for example, will display as:
This page has been accessed five thousand eight hundred sixtytwo times since October 1997.
while
Ce fichier a été accédé <accessed type=string lang=fr cheat=90
addreal> fois depuis <accessed lang=fr since>.
will display as:
Ce fichier a été accédé 5862 fois depuis octobre 1997.
|
|
|
- type=string: five thousand seven hundred seventytwo
type=roman :MMMMMDCCLXXII
type=mcdonalds: More than five thousand served.
type=linus: 5772 since Thu Oct 16 11:39:54 1997
type=number: 5772
This attribute allows you to specify how the access counting should
print; as a number (default), as a Roman numeral or something else.
Try them!
- upper
- Uppercases the string.
See also:
<DATE>and
<MODIFIED>.
Works like <apre> below but is used for turning on
and off configurations for individuals using
cookies1. This is done by preceding the name
of the configuration type with a plus sign (+) to turn it on or a
minus sign (-) to turn it off. Without the href attribute
it is just a link to the same page. Note that the user won't see the
change until he has requested the page again because of the way cookies
work.
In the following example we first check if background mode is on. If this is
the case we send the <body> tag with the background
attribute, otherwise without. After doing this, we definetwo
links of which only one is sent. If background mode is on we give
the user the possibility of turning it off and vice versa. The
configurations are present in the URL in the same way as pre-states are
except that they are between <...>, cf. footnote 1 and
<apre> below.
|
<html>
<if config=bg>
<body background=foo.jpg>
<otherwise>
<body>
</if>
Welcome to my page on the web.
<hr>
<if config=bg>
<aconf -bg>[Turn off background]</aconf>
<otherwise>
<aconf +bg>[Turn on background]</aconf>
</if>
...Some HTML...
</body>
</html>
|
|
|
<apre href=URL>...</apre> is used instead of
<a href=URL>...</a> to make it possible to
add pre-state relative links
2. If used without href, it's
just a link to the same page.
Suppose we have requested the following URL:
http://computer.idonex.se/(sv)/ap.html. If the source
looks like this:
|
<html>
<body>
<if prestate=sv>
<apre -sv en>Swedish</apre>
<otherwise>
<apre sv -en>English</apre>
</if>
<hr noshade>
<if prestate=en>
Denna text är på svenska, om du vill ha engelska klicka på länken ovan
<otherwise>
This information is provided to you in English, if you want it
in Swedish please press the above link.
</if>
</body>
</html>
|
The page shown in Figure 1.1 will be displayed.
|
|
|
Figure 1.1
|
|
As you might realize, the parenthesized part is the pre-state. It is
part of the URL, but Roxen removes the pre-state(s) when choosing the
page to send, remember them while parsing the page so that you can
check them using <if> in order to customize the
page.
Notice that pre-state links only work with URLs within the server. Absolute
URLs do not work:
<apre -sv href="http://your.own.domain/">HOME</apre>
does not work, but
<apre -sv href="/">HOME</apre>
does.
Of course you may use the ordinary anchor tag doing pre-state
insertion by hand;
<a href="http://your.own.domain/(sv)/">HOME</a>
to achieve the same thing.
See also
<IF>, <ELSE>
and<OTHERWISE>.
This tag adds a <br> to all line feeds.
Attributes
- p
- Replace all double linefeeds with a <p>
This tag is quite reminiscent of the <dthought>
tag
and is replaced by a random Bastard operator excuse. It is only
available when the BOFH module is installed.
BOFH is an acronym for Bastard Operator From Hell, and if you've read
the BOFH series on the Internet you know what to expect.
The name of the client used, in case the user forgets.
Attributes
- full
- Inserts the full name of the client instead of
just the first part of it. For Netscape Navigator, as an example,
the full name is 'Mozilla <version> <platform> <OS
full version>', and the short name is 'Mozilla
<version>'.
All text written in the comment containers are comments. This means
that they will be removed before the file is sent to the client. Note
that this is not the same kind of comment as the HTML comment using
<!-- This is my comment --> syntax.
|
|
The <countdown> tag counts days, minutes, months etc. It also
allows you to state the time for a few special events. Note that this
tag can only be used when the Coundown module is enabled.
Time
- day=initday_name
- Sets the weekday.
- hour=int
- Sets the hour.
- iso=year-month-day
- Sets the year, month and day at once.
- mday=int
- Sets the month's day.
- min=int
- Sets the minute.
- month=initmonth_name
- Sets the month.
- sec=int
- Sets the second.
- year=int
- Sets the year.
Special Events
- Christmas
- Christmas_Day
- Christmas_Eve
- Easter
- year2000
Presentation
- days
- Specifies how many days it rests until the time.
- hours
- Specifies how many hours it rests until the time.
- lang=language
- Indicates the language to be used.
- minutes
- Specifies how many minutes it rests until the time.
- months
- Specifies how many months it rests until the time.
- nowp
- Returns 1 or 0, depending on if the time is _now_ or not. The fuzziness of
'now' is decided by the 'prec' option. Per default, this is set to 'day'.
- prec
- Modifier for 'nowp'. Can be one of year, month, week, day, hour minute
of second.
- seconds
- Specifies how many seconds it rest until the time.
- since
- States the amount of time since the date.
- type=type
- See Time related attributes for a more thorough
desription. Useful
values for type include string, number and ordered.
- weeks
- Specifies how many weeks it rests until the time.
- when
- Shows when the time will occur. All arguments that are valid in
the <date> tag can be used to modify the display.
- years
- Specifies how many years it rests until the time.
Examples
|
Per is <countdown iso=1973-01-16 since years type=string>
years old.
will result in:
Per is twentyfive
|
The age of someone/something
|
|
|
There is <countdown year2000 days> left until year
2000.
will result in:
There is 668 days left until year 2000.
|
Days left to year 2000
|
|
|
<countdown christmas_eve_lang=en when date part=day
type=string>
will result in:
It will be a Tuesday
|
On which day will next Christmas Eve be?
|
|
|
|
For more information on countdown type <countdown help>.
Inserts the (more or less) current date.
Attributes
- day=+/-X
- Add (remove) X days to (from) the date.
- hour=+/-X
- Ditto, but add (remove) X hours instead.
- minute=+/-X
- Ditto, but add (remove) X minutes instead.
- second=+/-X
- Ditto, but add (remove) X seconds instead .
See also
<ACCESSED>and
<MODIFIED>.
Roxen has support for making macros. This is useful for making
site wide definitions of titles or menu items, thus making it easier to
create uniform-looking pages, not to mention changing the whole layout
in one fell swoop. It is possible to make a define in a define, and
using <insert name=foo> inside a definition also
works.
<define>
<define>
Defines a macro to be used by <insert> later on.
Attributes
- name=macro
- Defines this macro.
<define name=1>This is macro number one</define>
Used to insert macros, variables, cookies cf.
footnote 2 and files. The format is as follows:
<insert
name=name|variable=name|cookie=name|variables[=full]|
cookies[=full]|file=path fromword=toword>
Note the "|" characters. You can only use one of the attributes in
every <insert>. The attributes between the [ ] are
optional. Replacing words is possible all the time (cf example below).
Attributes
- cookie=foo
- Inserts the value of the cookie named name.
- cookies[=full]
- Inserts the values of all cookies, more or less verbose.
- file=path
- Inserts the file path. This file will then be fetched
just as if someone had tried to fetch it with an HTTP
request. This makes it possible to include things like Pike script
results and such.
If path does not begin with "/", it is assumed to be a
URL relative to the directory containing the file that has the
<insert> tag in it, i.e. the file where the
inserted text is finally parsed.
|
|
Note that included files will be parsed if they are named with the
extension .html (or whatever extension the RXML
parser should parse according to configurations in the main RXML
parser module). It's not a good idea to name include files like
this, because it might render define tags unusable.
If we put <insert file="aaa/bbb"> in the file
ccc.html and aaa/bbb contains
<insert file=ddd>, Roxen will look for
ddd in the directory where ccc.html
is. If we change the first <insert> to
<insert file="aaa/bbb.html"> and rename
aaa/bbb to aaa/bbb.html, Roxen
will instead look for ddd in the directory
aaa/.
- fromword=toword
- Replaces fromword with
toword in the macro or file. Note that only lowercase
character sequences can be replaced.
- name=macroname
- Inserts this macro, which should have
been defined by <define> before it is used. If it
resides in another file, you have to <insert
file=filename> before you can insert the macro, see
example below.
|
Lets define a macro called "foo", saving it in the file "mymacro"
<define name=foo>This is a foo</define>
Then we insert this macro somewhere:
<insert file=mymacro>
<insert name=foo>
The text sent to the client is:
This is a foo
If we insert the above macro but tell Roxen to replace the word
foo with the word cat:
<insert name=foo foo=cat>
we will get:
This is a cat
Let's try another example:
<insert name=foo a=some foo=cats is=are>
Result:There are some cats
Note that even parts of words are exchanged; "This" becomes "There".
Notice also that only lowercase characters can be replaced:
<insert name=foo This=this a=fun foo= >
for example
will result in: This is fun
|
|
|
- nocache
- File includes are normally cached. If the
nocache flag is specified, that cache won't be used. Useful when
including dynamic documents, like Pike-scripts.
- variable=name
- Inserts the value of the variable named
name.
- variables[=full]
- Inserts all variables, more or less
verbose.
Note that the result of<insert file=/includes> is
that the contents of the file /includes is inserted
here. Note also that macros defined in this file are not inserted until
they are called by <insert name=macro>. This is very
useful for making site-wide defines (like heads, titles etc.), used in
all files in a server, thus simplifying the code generation a lot.
Suppose you would like to create a site with several pages for your
company. You would probably want a consistent layout on all pages. You
might for example want to put your company logo at the top of every
page.
|
|
In order to simply accomplish a consistent design throughout all
your pages, we strongly recommend you to use macros. The following
markup shows a macro for use at the top and the bottom of the
pages.
|
<define name=top>
<img border="0" align="middle" src="idonex.gif"> Idonex
<hr size=2>
<user name=peter email link>
<br>
Last update <modified>
</body>
</html>
</define>
|
The macro file containing only
the definitions of header and footer.
|
|
Using this macro will include the company logo together with the
company name at the top of the page. The address of the user
as well as an email link, and when the page was last modified will
be included at the bottom of the page. This will, of course, only be
done if you insert the file macros in your HTML file:
|
<HTML>
<HEAD>
<TITLE>This is a title</TITLE>
</HEAD>
<BODY>
<insert file=macros>
<insert name=top>
..all the things you want to include in your page..
<insert name=bottom>
</BODY>
</HTML>
|
Macros
|
|
|
|
Note that the file macros does not have an extension. The
reason for this is that if you put .html or even .rxml
at the end of the name, the file will be parsed before being inserted
and we don't want that in this case. Which extensions that should
result in Roxen parsing the file is configurable.
This is useful for writing HTML-examples. Inside the DOC containers
you can write "{" instead of "<" and "}" instead of
" >".
Attributes
pre
Encloses the section within
<pre>...</pre> as well.
This tag is only available if you have installed the deep thought
module. The tag is replaced by a random "deep thought".
In short this tag returns the value of a given variable.
Function best illustrated of the following example:
|
<if variable=foo>
<formoutput>The variable foo has the value #foo#.</formoutput>
</if>
<else>
<form action=rxml.html>
<input type=string name=foo value="Bar">
<input type=submit value="OK">
</form>
</else>
|
|
|
The code will display this (in netscape 3.01 gold unix version):
Clicking on OK would result in this being displayed:
The variable foo has the value Bar.
The <gclock> tag inserts an analog clock on your site as an
image, displaying the correct time.
The Pike image module must be loaded to use this tag.
Attributes
- dial=default|roxen|searchpath to ppm-image
- the dial of the clock
- offset=n
- clock offset in n seconds from system clock
- handcolor=color
- color of the clock hands
- handoffset=n
- n is [pixels] subtracted from hands length
Adds a header to the head of the response. When a browser sends a
request for a file, the server returns a few lines reporting
something about the result of the request and what kind of file the
browser requested. By using this tag you can extend and/or modify this
header, telling the browser, for example that the file demands
authorization in order to be viewed.
Attributes
- Add
- Adds »header name«:»value« to the response. See Appendix C
for suggestions of headers to add.
<header name="refresh" value="10">, for example will reload the page every 10 minutes.
If you wish to see what the server returns try the following
example:
telnet myserver.com 80
and you will see:
Trying 123.4.56.789... Connected to myserver.com.
Escape character is '^]'.
See also <RETURN>.
<if> can be used to show the enclosed section when
certain conditions are met. You can also use <else>
or <otherwise> in order to suggest alternative
actions if the conditions do not evaluate to a true value.
|
|
These are perhaps the most useful tags in RXML. Among other things, they
allow you to write HTML-code that is only showed to people with a
certain client. You can for example make a table, that if viewed on a
non-table compliant client uses pre-formatted text, or maybe even a
completely different text instead.
Note that the part(s) that should not be seen according to the
conditions, are not even sent which means that the person looking at
your page won't even know that he/she isn't seeing everything. This
also makes it possible to entertain the illusion of dynamic pages,
without using scripts, through clever use of RXML tags.
The syntax is as follows:
|
<if some condition>
some condition occurred
</if>
<else>
something else happened
</else>
is equivalent to
<if some condition>
some condition occurred
<otherwise>
something else happened
</if>
|
|
|
|
|
If you don't use <if> before
<else>, the result is unpredictable.
Below are the possible attributes to this tag. There are a lot of them
and they have been divided into Conditionals (the de facto checks) and
Modifiers (slight change in behavior of the
checks).
- accept=type1[,type2,...]
- The type refers to content-type, e.g. image/jpeg or
text/html. The values can contain * (for several
arbitrary characters) and ? (for any simple character). Every client
tells the server what it thinks it can deal with so this is one
way of ensuring that nothing is sent that the browser can't
handle.
- cookie="name[ is value]"
- Returns true if the cookie named name exists. If you
also include the part about value the expression is of course only
true if the cookie holds that value. The value can contain * (for
several arbitrary characters) and ? (for any simple character).
- date=yymmdd
- Shows the enclosed section if the date is
yymmdd.
Modifiers: before, after and
inclusive.
|
<if after date=971221> <if before date=971229>
<b>Merry Christmas</b>
</if>
</if>
will display Merry Christmas if the date is between
971221 and 971229. Adding the inclusive attribute will
display Merry Christmas on 971221 and 971229 as
well.
|
|
|
- defined=definedmacro
- Shows the enclosed section if the
macro definedmacro is defined. Wild cards work as for
cookie.
- domain=pattern[,pattern...]
- Shows the enclosed section only to hosts whose DNS name match
these pattern(s). Note that domain names are resolved
asynchronously. This means that the first time someone accesses
this page, the host name will be the same as the IP number.
- host=pattern[,pattern...]
- Shows the enclosed section
only to hosts whose IP numbers match one of these pattern(s).
- language=language1[,lang2, ...]
- True if the client prefers the language(s) listed. * and ? may be
used and work as for cookie.
Available languages are
Catala (ca or es_CA), Croatian (hr), Dutch(du), English (en,
default), Finnish (fi),French (fr) German (de), Japanese (jp),
Italian (it), Maori (mi), Norwegian (no), Russian (ru), Serbian
(sr), Slovenian(si), Spanish (es),Swedish (se) Portuguese (pt).
Roxen determines which language to present by looking at the
request-header Accept-Languages.
- name=pattern[,pattern,...]
- If the full name of the
client matches the given pattern, show the enclosed text.
- prestate=state1[,state2, ...]
- Shows the enclosed text, only if all the specified pre-states are
present. The pre-states are
prepended to the URL with this syntax:
http://www.whatever.domain/(prestate)/my/nice/page.html.
See <APRE>for more information.
- referrer
- Shows the enclosed text, only if the
referrer header is supplied by the client.
If you add a pattern (referrer=pattern[,pattern,...])
then send the enclosed text only if the referrer header matches the
pattern(s). See
<REFERRER> for more information.
- supports=feature
- If the client supports the given
feature, include the enclosed section. This is configurable (under
Global Variables/ Client supports regexps). These are the
available features:
- backgrounds
The client supports backgrounds according
to the HTML3 specifications.
- bigsmall
The client understands the <big>
and <small> tags.
- center
The <center> tag for centering
HTML objects is supported.
- cookies
The client can receive cookies.
- divisions
The client can at least handle <div
align=...>
- font
The client supports at least <font
size=foo>.
- fontcolor
You can change the color of individual
characters.
- fonttype
- The browser can set the font, cf. Microsoft
Internet Explorer.
- forms
Forms according to the HTML 2.0 and 3.0
specification are supported.
- frames
The client supports frames.
- gifinline
The client can show GIF images inline.
- imagealign
The client supports align=left
and align=right in images, à la Netscape.
- images
The client can display images.
- java
The client supports Java applets.
- javascript
The client supports Java scripts.
- jpeginline
The client can show JPEG images in line.
- mailto
The mailto function can be used.
- math
The <math> tag is correctly
displayed by the browser.
- perl
The client supports Perl applets.
- pjpeginline
The client can handle progressive JPEG images
(.pjpeg) inline.
- pnginline
The client can handle .png images
in line.
- pull
The client handles Client Pull.
- push
The client can handle Server Push.
- python
The client supports Python applets.
- robot
The request really comes from a search robot,
not an actual browser.
- stylesheets
The client handles stylesheets (à la
Arena).
- supsub
Handles <sup> and <sub>
(superscript and subscript, respectively).
- tables
Tables according to the HTML 3.0 specification
are supported.
- tcl
Supports TCL applets.
- vrml
The client supports VRML.
This list is refreshed automatically every week directly from our
site (idonex.se) unless you explicitly tell Roxen not to do this
by setting Update the supports database automatically
under Global Variables to No. The list is a
list of browsers and what features they can handle, not something
the browser sends.
- user=name[,name,...]|any
- Shows the enclosed section
only to the user name, or, if any is
specified, to any valid user on the system. Unless the modifier
file=X is specified, the default user data base is
used.
- Modifiers: file=X, wwwfile.
A useful application of the user option might be:
|
<if not user=any>
<header name=WWW-Authenticate value="Basic;
Realm=Pers">
<return code=401>
<h1>Access denied</h1> You may not see this
document without a valid user name and password.
</if>
<else>
.. The secret document ..
</else>
|
|
|
This will force a user entry. |
|
But please note that if the user presses
the Cancel button, or refuses to enter an authentication,
the parts of the document that is outside
<else>...</else> will be shown to him or
her.
- variable
- Works exactly like cookie.
This conditional can for example be used when making a form. The
following markup:
|
<form>
<select name=foo>
<if variable="foo is yes">
<option selected>yes
<option>no
<otherwise>
<option>yes
<option selected>no
</if>
</select>
<input type=submit name=test>
</form>
<if variable="foo is yes">
Foo is on
<otherwise>
Foo is off
</else>
|
|
|
-
- will display as:
Choosing Yes in the form will turn on the variable "foo" while
no will turn it off.
- config=configuration
- If you have set a user's
configuration through the use of one or several <aconf
+/-configuration> you can use this conditional to check
it. It works like pre-states but is instead saved on the client
side through the use of cookies.
Used in conjunction with some of the conditionals.
- after
- Used together with <if after
date=yymmdd>. Show the enclosed section if the current
date is after yymmdd.
- and
- Shows the enclosed text only if all tests are true
(default).
- before
- Used together with <if before
date=yymmdd>. Shows the enclosed section if the current
date is before yymmdd.
- file=X
- Modifies the user=userid value. If
this is specified, the user:password pairs will be
taken from an external file of this format:
user name:encrypted-password
user name:encrypted-password
Unless wwwfile is present, it is assumed that the file
"X" is an absolute pathname in the real file system, like
/usr/www/security/localpasswd.
- inclusive
- Used together with <if
date=yymmdd> and before or after. Shows the enclosed
section if the current date is the same as or before/after yymmdd.
- wwwfile
- Indicates that the file "X" is a file in the
virtual file system of the server. This might be a security
problem, since everyone can read it via WWW.
- not
- Inverts the results of all test that is: not(condition1 and
condition2).
- or
- Shows the enclosed text if at least one of the tests
are true.
The example below shows how to make part of a page (in this case a list
item) available to locals only, using the host
attribute:
|
<if host="130.236.25?.*">
<li><a href="/local/">Local info</a>Only
available to local clients
</if>
|
|
|
This tag was implemented for debugging purposes. It sends a list of
all languages supported by the client. This helps you find out if you're
doing something wrong or if the client doesn't do it's job
properly. The only attribute is full, which when included
gives you a somewhat more verbose list. The list is shown in the HTML
code. Note though, that the list can only be displayed if the
browser sends such a list.
Inserts the date when the page was last modified or by whom it was modified.
Attributes
- by
- This tag will insert {user
name=user}, where user is the last one to
modify the file.
|
This file was last modified by <modified
by>
will show as:
This file was last modified by Erik Svensson <erik@idonex.se>
|
|
|
- file=virtual
- Insert the modification date of the file
virtual in the virtual file system. This tag can also be
used together with by.
- realfile=file
- Inserts the modification date of the file
file in the real file system. This tag can also be used
together with by.
See also: <DATE>
and <ACCESSED>.
The <pr> tag easily lets you insert an "Powered by Roxen"
logo

on you web site. Place the <pr> anywhere in the RXML code and
the logo willbe inserted.
Sometimes you wish to use the quotation marks for something apart from
quotes. In that case you should, in order to avoid confusing yourself
or the server, define other characters as starting and ending
quotation marks, respectively.
Attributes
- start=start_char
- The character beginning a quotation.
- end=end_char
- The character that ends a quotation.
{quote start='{' end='}'}
{insert name=foo bar={"foo" bar gazonk
'elefant' snabel}
Since we have redefined quotation marks to being curly brackets,
bar gets the value equaling the sequence of characters
between the curly brackets. If we had not made this redefinition
bar would have been just "{" or something unpredictable due
to the placement of the ordinary quotation marks.
Randomly select a part of the document.
The text between <random> and
</random> will be split on the specified separator,
and one of the resulting parts will be returned, which one it will be
is randomly selected.
Attributes
- separator=string
- The separator to be used. If none is
specified, newline will be used.
<random separator=+>
This is a test+This is not a test+What is this?
</random>
will cause Roxen to send one, and only one, of the three sentences
separated by the plus signs. |
The Referrer field allows the client to specify, for the server's
benefit, the address, URL, of the document (or element within the
document) from which the Request-URL was obtained.
|
|
Insert the referrer!
It's good practice because it can help you track down faulty links.
Clicking on the link Click here! of the following markup will take us
to the page shown in Figure 1.2:
|
<html>
<head>
<title>Reftest</title>
</head>
<body bgcolor="ffffff">
<font size=4>Welcome to the
<doc>"<"Referrer">"</doc>Testpage!</font><p>
<a href=test2.html>Click here!</a>
</body>
</html>
|
|
|
|
Figure 1.3
|
|
The markup for this page is:
|
<html>
<head>
<title>test</title>
</head>
<body bgcolor="#ffffff">
<font size=4>Welcome to my page</font><p>
This page has been accessed
<accessed cheat=100> times
<p>
<hr>
<i>This page was requested from
the following URL:</i><referrer>
</body>
</html>
|
|
|
The referrer tag can also be used for making a "back button", a link back to
the page the user previously visited. We recommend that you use it
together with <if referrer>.
Including: <if referrer><a href="<referrer>">TURN
BACK!</a></if> instead of only <referrer>
in your document, for example, will
display TURN BACK! allowing
the user to easily get back to the previous page.
Removes a cookie. The attribute name=cookiename must be present.
See also <SET_COOKIE>.
Returns an HTTP result code other than 200, which is the regular, "no
problem", return code.
Attributes
- <return code=c>
- This will return the response
c. Note that most of them are quite odd to have in a
document, especially the server errors. See the listing in
Appendix D. See also <HEADER>.
Sets the cookie called name to value.
Attributes
- name=name
- Gives the cookie a name.
- value=value
- Assigns a value to the cookie.
- persistent
- Tells the client to save the cookie forever.
See also <REMOVE_COOKIE>.
Like <user>, but with some more bells and
whistles. The result will in fact be:
|
<p><table width=100%><tr><td align=right><address>
<a href="/username/">realname</a>
<a href="mailto:emailaddress">
<emailaddress></a></address></td></tr></table>
|
|
|
Attributes are the same as those of
<USER>.
This tag takes the enclosed string and turns it into a string of
smallcaps.
Attributes
- size=x
- Sets the base font size to x, which can be between
1 and 7. This is what is used for the capitals.
- small=x
- Sets the font size for the letters typed in small.
- space
- Inserts a space between every character in the string.
|
<smallcaps size=4 small=3>It's a Rainy day
</smallcaps>
|
|
|
will display as:
IT'S A RAINY DAY
The <SOURCE> tag shows both the source and the parsed result of
the enclosed section and is very useful when writing HTML examples of
your own.
Attributes
- separator="Separator string"
- Use this separator
instead of the default "Result".
The following markup:
|
<source separator="This is what it will look like when Roxen has
parsed the enclosed section">
<font size=+9><b>Bold</b></font>
<H5>This is a small heading</h5></source>
|
|
|
will be displayed as:
|
<font size=+9><b>Bold</b></font>
<H5>This is a small heading</h5>
This is what it will look like when Roxen has
parsed the enclosed section
Bold
This is a small heading
|
|
You can let Roxen automatically generate tables for you by installing
the Tablify module. This module lets you do the following:
|
<tablify>
tab separated text
</tablify>
|
|
|
and then Roxen sends an HTML 2.0 table to the browser instead of the
tab separated text. Rows are separated by newlines and cells are
separated by tab stops. A table coded in HTML like:
|
<TABLE BORDER>
<caption align="bottom">This is the title</caption>
<TR> <TH>French <TH> English </TR>
<TR> <TD> chat </TD> <TD>cat</TD> </TR>
<TR> <TD> chien </TD> <TD>dog </TD></TR>
</TABLE>
|
|
|
will in RXML be coded as:
|
<tablify border=1>
<b>French</b> <b>English</b>
chat cat
chien dog
</tablify>
|
|
|
This will display as:
French | English |
chat | cat |
chien | dog |
|
Inserts the real name and email address of a user as a link.
The default output is "Real Name <user@your.domain>".
Attributes
- name=username
- Inserts data about this user, modified by
realname, email and nolink.
- realname
- Inserts only the real name of the user,
modified by link.
- email
- Inserts only the email address of the user,
modified by link.
- link
- Links the text consisting of the user's name, Real
Name, to the home page of the user, and the email to a
mailto: link. This is the default for the default
action (i.e. with no email or realname modifiers present).
- nolink
- Add no links whatsoever. This is the default
when any of the email and realname modifiers
are present.
These attributes can be added to RXML tags related to dates, like
<modified> and <accessed>.
- type=discordian|stardate
- These attributes only make a
difference when not using part (see
below). Note that stardate has a separate companion
attribute, prec, which sets the precision.
- type=number|string|roman
- lang=language
- When using type=string,
return the equivalent in the given language. This also affects the
part attribute, see below.
Available languages are
Swedish (se), Finnish (fi), German (de), Catala (ca or es_CA),
Dutch (du), Spanish (es), French (fr), English (en, default) and
Norwegian (no).
- part=year|month|day|date|hour|minute|second|yday
- year; The year
- month; The month
- day; The weekday, starting with Sunday.
- date; The number of days since the first this month.
- hour; The number of hours since midnight.
- minute; The number of minutes since the last full hour.
- second; The number of seconds since the last full minute.
- yday; The day since the first of january.
The return value of these parts are modified by both
type and lang.
- time
- Only show the time.
- date
- Only show the date.
- capitalize
- Capitalizes the first letter of the string.
- lower
- Lowercases the string.
- upper
- Uppercases the string.
1
A cookie is a way of keeping information about someone by saving
information at the client side of the http exchange. As a simple
example you could have a cookie named counter and give one to everyone
accessing your page for the first time and then increasing its value
by one every time they request the page, thereby keeping an individual
access count. Supported by the Netscape Navigator and the Microsoft
Internet Explorer.
2
A pre-state is part of the URL and is a way of setting variables so
that you can for example use <if> to change the layout of a page
without having to make multiple files. The pre-state is part of the
URL, but it isn't a separate directory.
|
Previous Chapter
Next Chapter
Table of Contents
Index
| |