You must hand in by using git
bitbucket.org,
gitlab.com, or
github.com,
git push your local repo to the above remote repo.
node_modules/
.gitignore file.
Send a mail to <nmla@iba.dk> with:
handin <subjectname>'
in the subject line of your mail
First write the xml document:
<?xml version="1.0" encoding="UTF-8"?>
<emails>
<email>
<to>Mum</to>
<from>Porky</from>
<subject>Greetings</subject>
<message>Hello Mums, could you PLEASE send some more money</message>
</email>
</emails>Here follows the first XSLT, key it into your editor:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text"/>
<!-- 1st step -->
<xsl:template match="/emails/email">
<xsl:apply-templates select="*"/>
</xsl:template>
<!-- 2nd step -->
<xsl:template match="from">
From: <xsl:apply-templates/>
</xsl:template>
<xsl:template match="subject">
Subject: <xsl:apply-templates/>
</xsl:template>
<xsl:template match="message">
Message: <xsl:apply-templates/>
</xsl:template>
<xsl:template match="to">
To: <xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Key in both documents and display them separately in your
browser. When you have done that, add the following line as
line 2 of the xml file above. Then display the altered xml file
in the browser with the http protocol, ie not file:///
<?xml-stylesheet type="text/xsl" href="./letter0.xsl"?>
Then write the following, different, stylesheet document, aka xsl-document.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml"
version="1.0">
<xsl:output method="xml"/>
<!-- 1st step -->
<xsl:template match="/emails/email">
<html>
<head><title>Letter</title></head>
<body><xsl:apply-templates/></body>
</html>
</xsl:template>
<xsl:template match="to">
<b>To: </b><xsl:apply-templates/><br />
</xsl:template>
<xsl:template match="from">
<b>From: </b><xsl:apply-templates/><br />
</xsl:template>
<xsl:template match="subject">
<b>Subject: </b><xsl:apply-templates/><br />
</xsl:template>
<xsl:template match="message">
<b>Message: </b><xsl:apply-templates/><br />
</xsl:template>
</xsl:stylesheet>
That sheet will transform the XML document to html. Apply a reference to that stylesheet instead in your xml document, and check again in the browser.
Check out the results. Learn from your typing errors, and possibly do some experiments.
Try to think of creating notes when listening to a lecture, or a presentation. Then think of an XML format that might hold those notes. It could be context, date, lecturer, headline, notes etc.
Write an xml file
lecturenotes.xml
with tags corresponding to your ideas.
Put imaginary notes into the file from at least two
different lectures, each containing at least two notes.
Write each of the following, and test in your browser before submitting. No CSS in this assignment.
countries.xml containing an
XML representation of a couple of countries
from the world database.
cities.xml containing an
XML representation of a couple of cities
from the world database.
languages.xml containing an
XML representation of a couple of countrylanguages
from the world database.
continents.xml containing an
XML representation of the continents
from the world database.
governmentforms.xml containing an
XML representation of a couple of governmentforms
from the world database.