XML and XSL Demo

This Demo Requires Internet Explorer 5.5 or some other XML enabled browser (Not Netscape 4.x).



  simple.xml Download this XML file


<?xml version="1.0"?>
<breakfast-menu>
   <food>
      <name>Belgian Waffles</name>
      <price>$5.95</price>
      <description>two of our famous Belgian Waffles with plenty of real maple syrup</description>
      <calories>650</calories>
   </food>
   <food>
      <name>Strawberry Belgian Waffles</name>
      <price>$7.95</price>
      <description>light Belgian waffles covered with strawberries and whipped cream</description>
      <calories>900</calories>
   </food>
   <food>
      <name>Berry-Berry Belgian Waffles</name>
      <price>$8.95</price>
      <description>light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
      <calories>900</calories>
   </food>
   <food>
      <name>French Toast</name>
      <price>$4.50</price>
      <description>thick slices made from our homemade sourdough bread</description>
      <calories>600</calories>
   </food>
   <food>
      <name>Homestyle Breakfast</name>
      <price>$6.95</price>
      <description>two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
      <calories>950</calories>
   </food>
</breakfast-menu>




  simple.xsl Download this XSL file



<?xml version="1.0"?>
<HTML xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  <BODY STYLE="font-family:Arial, helvetica, sans-serif; font-size:12pt;
        background-color:#EEEEEE">
    <xsl:for-each select="breakfast-menu/food">
      <DIV STYLE="background-color:teal; color:white; padding:4px">
        <SPAN STYLE="font-weight:bold; color:white"><xsl:value-of select="name"/></SPAN>
        - <xsl:value-of select="price"/>
      </DIV>
      <DIV STYLE="margin-left:20px; margin-bottom:1em; font-size:10pt">
        <xsl:value-of select="description"/>
        <SPAN STYLE="font-style:italic">
          (<xsl:value-of select="calories"/> calories per serving)
        </SPAN>
      </DIV>
    </xsl:for-each>
  </BODY>
</HTML>




  simplexsl.xml Download this XML file


<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="simple.xsl" ?>
<breakfast-menu>
   <food>
      <name>Belgian Waffles</name>
      <price>$5.95</price>
      <description>two of our famous Belgian Waffles with plenty of real maple syrup</description>
      <calories>650</calories>
   </food>
   <food>
      <name>Strawberry Belgian Waffles</name>
      <price>$7.95</price>
      <description>light Belgian waffles covered with strawberries and whipped cream</description>
      <calories>900</calories>
   </food>
   <food>
      <name>Berry-Berry Belgian Waffles</name>
      <price>$8.95</price>
      <description>light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>
      <calories>900</calories>
   </food>
   <food>
      <name>French Toast</name>
      <price>$4.50</price>
      <description>thick slices made from our homemade sourdough bread</description>
      <calories>600</calories>
   </food>
   <food>
      <name>Homestyle Breakfast</name>
      <price>$6.95</price>
      <description>two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>
      <calories>950</calories>
   </food>
</breakfast-menu>


Send comments and mail to the WebMaster.