Web technologies -- Laboratory 4 -- 2007-2008 -- info.uvt.ro
Navigation
edit- Web technologies -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 1 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 2 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 3 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 4 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 5 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 6 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 7 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 8 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 9 -- 2007-2008 -- info.uvt.ro
- Web technologies -- Laboratory 10 -- 2007-2008 -- info.uvt.ro
XML
editReferences
edit
Discussion points
edit
Example
edit <?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="queue.xsl"?>
<queue>
<link>
<name>Paul Graham -- The Roots of Lisp</name>
<uri>http://www.paulgraham.com/rootsoflisp.html</uri>
</link>
<link>
<name>LL1: Lightweight Languages Workshop</name>
<uri>http://ll1.ai.mit.edu/</uri>
</link>
<link>
<name>The Java Language Environment</name>
<uri>http://java.sun.com/docs/white/langenv/</uri>
</link>
<link>
<name>The Evolution of Lisp</name>
<uri>http://citeseer.ist.psu.edu/steele93evolution.html</uri>
</link>
<link>
<name>Delimited continuations in operating systems</name>
<uri>http://okmij.org/ftp/papers/context-OS.pdf</uri>
</link>
<link>
<name>Pascal Costanza's Highly Opinionated Guide to Lisp</name>
<uri>http://p-cos.net/lisp/guide.html</uri>
</link>
<!--
<link>
<name></name>
<uri></uri>
</link>
-->
</queue>
XSL
editReferences
edit
XSLT
editReferences
edit
Discussion points
edit
Example
edit <?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/queue">
<html>
<head>
<title>Reading queue</title>
</head>
<body>
<ul>
<xsl:for-each select="./link">
<li>
<strong><xsl:value-of select="./name" /></strong>
<a>
<xsl:attribute name="href">
<xsl:value-of select="./uri" />
</xsl:attribute>
<xsl:value-of select="./uri" />
</a>
</li>
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Assignment
editFirst step: Create a database like XML (like the one in the example from above) file with:
- at least 10 record like elements (for example the link element);
- each record should have at least 4 attribute like elements (for example the name or uri element);
- each record should have at least 3 sub-records (for example I could extend the link elements to also contain multiple comment elements);
Second step: Create an XSLT file -- that is used by your XML file -- to transform the database into a HTML file. Each information available in the XML file should be presented in the generated HTML.
As usually the assignments should be commited using SVN in the folder <user-name>/assignment-03 in one of the repositories:
- svn://hephaistos.info.uvt.ro:41910/web-technologies
- http://hephaistos.info.uvt.ro/svn-repositories/web-technologies
Ciprian Dorin Craciun, 2007-10-24, ccraciun@info.uvt.ro