Lecture overview -- Keyboard shortcut: 'u'  Previous page: Program hosting -- Keyboard shortcut: 'p'  Next page: Program subsumption -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 9 : 30
XML Processing in LAML
Markup subsumption

Program fragments are represented in XML markup

An XML-only solution

<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/