I've decided to try and teach myself XML (again).
I came up with a DTD (that's valid)
And used it to do the following XML
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Timesheet SYSTEM "file:///C:/Documents and Settings/Jim/My Documents/XML/Timesheet.dtd">
<Timesheet>
<Employee>
<Name ID="1112763" SALARY="$9.25">John Smith</Name>
<Address Type="home">
<Street>1100 Main Street</Street>
<City>Anytown</City>
<State>PA</State>
<Zip>16121</Zip>
</Address>
<Position>Auditor</Position>
</Employee>
<Schedule>
<Store>
<Day>Monday</Day>
<Address Type="site">
<Site>SuperPetz</Site>
<City>Mechanicsburg</City>
<State>PA</State>
<Zip>17055</Zip>
</Address>
<StartTime>6AM</StartTime>
</Store>
<Store>
<Day>Wednesday</Day>
<Address Type="site">
<Site>Gander Mt.</Site>
<City>Harrisburg</City>
<State>PA</State>
<Zip>17000</Zip>
</Address>
<StartTime>5AM</StartTime>
</Store>
</Schedule>
</Timesheet>
Then I developed the following XSLT translation
Code:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/xhtml1/strict">
<xsl:output method="xml"/>
<xsl:template match="Timesheet">
<html>
<head>
<title>
<xsl:value-of select="Timesheet/Employee/Name"/>
</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="Timesheet/Employee/Address">
<xsl:value-of select="Timesheet/Employee/Address/Street"/><br/>
<xsl:value-of select="Timesheet/Employee/Address/City"/><br/>
<xsl:value-of select="Timesheet/Employee/Address/State"/><br/>
<xsl:value-of select="Timesheet/Employee/Address/Zip"/><br/>
</xsl:template>
<xsl:template match="Timesheet/Employee/Position">
<xsl:value-of select="Timesheet/Employee/Position"/><br/>
</xsl:template>
<xsl:template match="Timesheet/Schedule">
<table>
<xsl:for-each select="Store">
<tr>
<td>
<xsl:value-of select="Store/Day"/>
</td>
<td>
<xsl:value-of select="Store/Address/Site"/><br/>
<xsl:value-of select="Store/Address/City"/><br/>
<xsl:value-of select="Store/Address/State"/><br/>
<xsl:value-of select="Store/Address/Zip"/>
</td>
<td>
<xsl:value-of select="Store/StartTime"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
But when I run the XSLT through MSXML(3.0) running inside XmlPad, all I get is a bunch of empty tags.
Is my XSL translator bad? Is the XSLT bad? Could I just create a CSS and import that into the XML, and how would I do this.