note 45228 added to ref.xsl
| From: | empusa at osu1 dot php dot net | Date: | Mon, 30 Aug 2004 14:11:09 +0000 |
| Subject: | note 45228 added to ref.xsl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75680@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/ref.xsl.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45228
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45228&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45228&report=yes
Search -- http://master.php.net/manage/user-notes.php