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  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Slide 9 : 30

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>