| <define name="factorial" args="x">
<if>
<lt><x/>2</lt>
<x/>
<multiply>
<x/>
<factorial><subtract><x/>1</subtract></factorial>
</multiply>
</if>
</define>
<html>
<head> <title> Factorial </title> </head>
<body>
<p> factorial(10) is <factorial> 10 </factorial> </p>
</body>
</html> |
|
| | A factorial function programmed in the XML language XEXPR. The examples is taken from http://www.w3.org/TR/xexpr/
|