
<!-- THIS-IS-INTERNAL-RXML-DOC-AUTOMATICLY-GENERATED-FROM-THE-MANUAL -->
</dump-if>







































































<table cellpadding=1 cellspacing=0 border=0>
<tr>
<td bgcolor=#113377 width=1%>



<b><font color=#ffffff size=+3 >&nbsp;&lt;if&gt;&nbsp;...&nbsp;&lt;/if&gt;&nbsp;</font></b>

</td>
<td>
<img src=/internal-roxen-unit width=200 height=1 alt=""></td>
</tr>

<tr>
<td bgcolor=black colspan=2>


<table cellpadding=4 border=0 cellspacing=0 width=100%>
<tr>
<td bgcolor=#ffffff>



<tt>&lt;if&gt;</tt> is defined in the <i>Main RXML parser</i> module.
<p>
<tt>&lt;if&gt;</tt> is used to conditionally show its contents.
<tt>&lt;else&gt;</tt>, <tt>&lt;elif&gt;</tt> or <tt>&lt;elseif&gt;</tt> can be used to
suggest alternative content.

<p>It is possible to use glob patterns in almost all attributes, where
* means match zero or more characters while ? matches one character.
* Thus <tt>t*f??</tt> will match <tt>trainfoo</tt> as well as
* <tt>tfoo</tt> but not <tt>trainfork</tt> or <tt>tfo</tt>.


<br clear=all>
<img src=/internal-roxen-unit width=1 height=10 alt="">

</td>
</tr>
</table>


<table cellpadding=4 border=0 cellspacing=0>
<tr>
<td bgcolor=#113377 width=1%>
<font color=white>Attributes</font>
</td>
<td bgcolor=#ffffff>
<img src=/internal-roxen-unit width=100% height=1 alt=""></td>
</tr>
<tr>

<td bgcolor=#ffffff colspan=2>






<a href="#accept">accept</a>,
<a href="#config">config</a>,
<a href="#cookie">cookie</a>,
<a href="#date">date</a>,
<a href="#defined">defined</a>,
<a href="#domain">domain</a>,
<a href="#eval">eval</a>,
<a href="#exists">exists</a>,
<a href="#filename">filename</a>,
<a href="#host">host</a>,
<a href="#language">language</a>,
<a href="#match">match</a>,
<a href="#name">name</a>,
<a href="#prestate">prestate</a>,
<a href="#referrer">referrer</a>,
<a href="#supports">supports</a>,
<a href="#time">time</a>,
<a href="#user">user</a>,
<a href="#variable">variable</a>,
<a href="#after">after</a>,
<a href="#and">and</a>,
<a href="#before">before</a>,
<a href="#file">file</a>,
<a href="#group">group</a>,
<a href="#inclusive">inclusive</a>,
<a href="#wwwfile">wwwfile</a>,
<a href="#not">not</a>,
<a href="#or">or</a>,
&nbsp;

</td>
</tr>
</table>


</td>
</tr>
</table>






































<p>
<b><font color=#113377 size=+2 >Attributes</font></b>



<dl>

<p><dt><tt><b><a name="accept">accept</a></b></tt>=<i>type1[,type2,...]</i>
<dd>
Returns true is the browser accept certain content types as specified
by it's Accept-header, for example <i>image/jpeg</i> or
<i>text/html</i>. If browser states that it accepts */* that is not
taken in to account as this is always untrue.




<p><dt><tt><b><a name="config">config</a></b></tt>=<i>name</i>
<dd>
Has the config been set by use of the <tt>&lt;aconf&gt;</tt> tag?




<p><dt><tt><b><a name="cookie">cookie</a></b></tt>=<i>name[ is value]</i>
<dd>
Does the cookie exist and if <i>value</i> is given, does it contain
the value <i>value</i>?




<p><dt><tt><b><a name="date">date</a></b></tt>=<i>yyyymmdd</i>
<dd>
Is the date yyyymmdd? The attributes <tt>before</tt>,
<tt>after</tt> and <tt>inclusive</tt> modifies the behavior.




<p><dt><tt><b><a name="defined">defined</a></b></tt>=<i>define</i>
<dd>
Is the define defined?




<p><dt><tt><b><a name="domain">domain</a></b></tt>=<i>pattern[,pattern...]</i>
<dd>
Does the users computer's DNS name match any of the patterns? Note
that domain names are resolved asynchronously, and the the first time
someone accesses a page, the domain name will probably not have been
resolved.




<p><dt><tt><b><a name="eval">eval</a></b></tt>=<i>RXML expression</i>
<dd>
Returns true if <tt>RXML expression</font></tt> returns a string that
evaluates to true if casted to an integer in Pike, i.e. the string
begins with 1-9 or a number of zeroes followed by 1-7 (octal greater
than zero).

<b>Future versions of Roxen (starting from version 1.4) will
evaluate to true on a number of zeroes followed by 1-9 (decimal
greater than zero).</b>




<p><dt><tt><b><a name="exists">exists</a></b></tt>=<i>path</i>
<dd>
Returns true if the file <tt>path</font></tt> exists. If <tt>path</font></tt>
does not begin with <i>/</i>, it is assumed to be a URL relative
to the directory containing the page with the <tt>&lt;if&gt;</tt>-statement.




<p><dt><tt><b><a name="filename">filename</a></b></tt>=<i>filepattern1[,filepattern2,...]</i>
<dd>
Returns true if the current page is among the listed filepatterns.




<p><dt><tt><b><a name="host">host</a></b></tt>=<i>pattern[,pattern...]</i>
<dd>
Does the users computers IP address match any of the patterns?




<p><dt><tt><b><a name="language">language</a></b></tt>=<i>language1[,lang2,...]</i>
<dd>
Does the client prefer one of the languages listed, as specified by
the <tt>Accept-Language</tt> header?




<p><dt><tt><b><a name="match">match</a></b></tt>=<i>string[ is pattern[,pattern,...]]</i>
<dd>
Does the string match one of the patterns?




<p><dt><tt><b><a name="name">name</a></b></tt>=<i>pattern[,pattern...]</i>
<dd>
Does the full name of the browser match any of the patterns?






<p><dt><tt><b><a name="prestate">prestate</a></b></tt>=<i>option1[,option2, ...]</i>
<dd>
Are all of the specified prestate options present in the URL?




<p><dt><tt><b><a name="referrer">referrer</a></b></tt>=<i>[=pattern[,pattern,...]]</i>
<dd>
Does the referrer header match any of the patterns?




<p><dt><tt><b><a name="supports">supports</a></b></tt>=<i>feature</i>
<dd>
Does the browser support this feature? See the <a
href=../supports/classes.html>support feature page</a> page for a list
of all available features.




<p><dt><tt><b><a name="time">time</a></b></tt>=<i>ttmm</i>
<dd>
Is the date ttmm? The attributes <tt>before</tt>, <tt>after</tt>
and <tt>inclusive</tt> modifies the behavior.




<p><dt><tt><b><a name="user">user</a></b></tt>=<i>name[,name,...]|any</i>
<dd>
Has the user been authenticated as one of these users? If <i>any</i>
is given as argument, any authenticated user will do.




<p><dt><tt><b><a name="variable">variable</a></b></tt>=<i>name[ is pattern]</i>
<dd>
Does the variable exist and, optionally, does it's content match the
pattern?
</dl>

<p><b>Modifier Attributes</b>
<dl>




<p><dt><tt><b><a name="after">after</a></b></tt>

<dd>
Used together with the <tt>date</tt> attribute.



<p><dt><tt><b><a name="and">and</a></b></tt>

<dd>
If several conditional attributes are given all must be true for the
contents to be shown. This is the default behavior.



<p><dt><tt><b><a name="before">before</a></b></tt>

<dd>
Used together with the <tt>date</tt> attribute.



<p><dt><tt><b><a name="file">file</a></b></tt>=<i>path</i>
<dd>
Used together with the <tt>user</tt> attribute. An external file
will be used to authenticate the user, rather than the current
<i>Authentication</i> module. The file should have the following
format:

<p><pre>
user name : encrypted password
user name : encrypted password
</pre>

<p>Unless the <tt>wwwfile</tt> attribute is given the path is a path
in the computers real file system, rather than Challenger's virtual
file system.




<p><dt><tt><b><a name="group">group</a></b></tt>=<i>group, groupfile path</i>
<dd>
Used together with the <tt>user</tt> attribute to check if the
current user is a member of the group according the the groupfile. If 
groupfile is not specified, the internal user databases will be searched 
for group membership. The groupfile is of the following format:

<p><pre>
group : user1, user2, user3
group : user4
</pre>




<p><dt><tt><b><a name="inclusive">inclusive</a></b></tt>

<dd>
Used together with the <tt>date</tt> and <tt>before</tt> or
<tt>after</tt> attributes. The contents will also be shown if the
date is the current date.



<p><dt><tt><b><a name="wwwfile">wwwfile</a></b></tt>

<dd>
Used together with the <tt>file</tt> attribute to indicate what
Challenger's virtual file system should be used to find the password
file. This might be a security hazard, since anyone will be able to
read the password file.



<p><dt><tt><b><a name="not">not</a></b></tt>

<dd>
Inverts the results of all tests. 



<p><dt><tt><b><a name="or">or</a></b></tt>

<dd>
If several conditional attributes are given, only one of them has to
be true for the contents to be shown.


</dl>

<p>

<br>&nbsp;&nbsp;<a href="#Complex expressions"><define name=kludge2>Complex expressions</define><insert name=kludge2 " "=&nbsp;></a>


<icon type=warning>
<p>You might be tempted to write expressions like:

<p><doc><tt>{if variable="foo is bar" or variable="bar is
foo"}Something{/if}</font></tt></doc>

<p>This will not work, as you can only use an attribute once.

<p>Another common problem is a misconception of how the
<tt>and</tt>, <tt>or</tt> and <tt>not</tt> attributes work.

<p><doc><tt>{if user=foo or not domain="*.foobar.com"}...{/if}</font></tt></doc>

<p>will not work since the <tt>not</tt> attribute negates the whole
tag, not just the <tt>domain</tt> attribute.


<dl>

</dl>










<b><font color=#113377 size=+2 >Example</font></b>


<table border=0 cellpadding=1 cellspacing=0 bgcolor=#000000>
<tr>
<td>
<table border=0 cellspacing=0 cellpadding=4>
 <tr>
  <td valign=top bgcolor=#113377>
   <font color=#ffffff><b>source code</b></font>
  </td>
  <td bgcolor=white>
<pre><define name=foo>
<if supports=tables>
Your browser supports tables.
</if>
</define>
<insert name=foo "<"=&lt; ">"=&gt; ></pre>
   <br clear=all>
   <img src=/internal-roxen-unit width=1 height=1 alt="">
  </td>
 </tr>
 <tr>
  <td height=1 bgcolor=#113377><img src=/internal-roxen-unit width=1 height=1 alt=""></td>
  <td height=1 bgcolor=#ffffff>

   <table border=0 cellpadding=0 cellspacing=0 width=100%>
    <tr>
     <td bgcolor=#000000>
     <img src=/internal-roxen-unit width=1 height=1 alt=""></td>
    </tr>
   </table>
  </td>
 </tr>
 <tr>
  <td valign=top bgcolor=#113377>
  <font color=#ffffff><b>result</b></font>
</td>
<td valign=top bgcolor=#ffffff>


<if supports=tables>
Your browser supports tables.
</if>


   <br clear=all>
   <img src=/internal-roxen-unit width=1 height=1 alt="">
</td>
</tr>

</table>
</td>
</tr>
</table><p>
<table border=0 cellpadding=1 cellspacing=0 bgcolor=#000000>
<tr>
<td>
<table border=0 cellspacing=0 cellpadding=4>
 <tr>
  <td valign=top bgcolor=#113377>
   <font color=#ffffff><b>source code</b></font>
  </td>
  <td bgcolor=white>
<pre><define name=foo>
<if user=any>
You are logged in.
</if>
<else>
You are not logged in.
</else>
</define>
<insert name=foo "<"=&lt; ">"=&gt; ></pre>
   <br clear=all>
   <img src=/internal-roxen-unit width=1 height=1 alt="">
  </td>
 </tr>
 <tr>
  <td height=1 bgcolor=#113377><img src=/internal-roxen-unit width=1 height=1 alt=""></td>
  <td height=1 bgcolor=#ffffff>

   <table border=0 cellpadding=0 cellspacing=0 width=100%>
    <tr>
     <td bgcolor=#000000>
     <img src=/internal-roxen-unit width=1 height=1 alt=""></td>
    </tr>
   </table>
  </td>
 </tr>
 <tr>
  <td valign=top bgcolor=#113377>
  <font color=#ffffff><b>result</b></font>
</td>
<td valign=top bgcolor=#ffffff>


<if user=any>
You are logged in.
</if>
<else>
You are not logged in.
</else>


   <br clear=all>
   <img src=/internal-roxen-unit width=1 height=1 alt="">
</td>
</tr>

</table>
</td>
</tr>
</table><p>
<table border=0 cellpadding=1 cellspacing=0 bgcolor=#000000>
<tr>
<td>
<table border=0 cellspacing=0 cellpadding=4>
 <tr>
  <td valign=top bgcolor=#113377>
   <font color=#ffffff><b>source code</b></font>
  </td>
  <td bgcolor=white>
<pre><define name=foo>
<if date=20000101 before>
The year 2000 is yet to come.
</if>
</define>
<insert name=foo "<"=&lt; ">"=&gt; ></pre>
   <br clear=all>
   <img src=/internal-roxen-unit width=1 height=1 alt="">
  </td>
 </tr>
 <tr>
  <td height=1 bgcolor=#113377><img src=/internal-roxen-unit width=1 height=1 alt=""></td>
  <td height=1 bgcolor=#ffffff>

   <table border=0 cellpadding=0 cellspacing=0 width=100%>
    <tr>
     <td bgcolor=#000000>
     <img src=/internal-roxen-unit width=1 height=1 alt=""></td>
    </tr>
   </table>
  </td>
 </tr>
 <tr>
  <td valign=top bgcolor=#113377>
  <font color=#ffffff><b>result</b></font>
</td>
<td valign=top bgcolor=#ffffff>


<if date=20000101 before>
The year 2000 is yet to come.
</if>


   <br clear=all>
   <img src=/internal-roxen-unit width=1 height=1 alt="">
</td>
</tr>

</table>
</td>
</tr>
</table><p>


<if not cookie=rxml-help>

</td></tr>
</table>
</body>
</html>


