note 45228 deleted from ref.xsl by aidan
| From: | aidan@php.net | Date: | Tue, 31 Aug 2004 06:56:05 +0000 |
| Subject: | note 45228 deleted from ref.xsl by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75717@lists.php.net to get a copy of this message | ||
Note Submitter: empusa
----
I tried to get valid xhtml1.0 output. If you take the following examples, it will work.
xml-file
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test2.xsl"?>
<collection>
<cd>
<title>PHP Rock</title>
<artist>Joe Coder</artist>
<year>2003</year>
</cd>
<cd>
<title>Squashing Typos on a Winter's Eve</title>
<artist>kennyt</artist>
<year>2004</year>
</cd>
</collection>
xsl-file
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="xml" encoding="iso-8859-1" indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
/>
<xsl:template match="collection">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="de" lang="de">
<head>
<title>Titelliste</title>
</head>
<body>
<h1>Hey! Welcome to my sweet CD collection!</h1>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="cd">
<h1><xsl:value-of select="title"/></h1>
<h2>by <xsl:value-of select="artist"/></h2>
<h3> - <xsl:value-of select="year"/></h3>
</xsl:template>
</xsl:stylesheet>
Validated with the w3c-validator