I have been asked to convert a XML doc with an internal DTD and an external XSL into a neatly presented table with two sets of criteria - which I chose as two different authors.
TBH I don't even know if I have the XML & DTD doc right? And when it comes to using XPath and XSLT I have absolutely no idea what to do. I'm hoping someone can show me the finished table so that I can work backwards from it and understand how you did it.
Here is my XML Doc...
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Batman.xsl"?>
<!DOCTYPE comics [
<!ELEMENT comics (name,author,publisher,country,year,prics)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT country (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT price (#PCDATA)>
]>
<comics>
<batman>
<issue2>
<name>Batman Eternal</name>
<author>Scott Synder</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue2>
<issue3>
<name>Batman Eternal</name>
<author>Scott Synder</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue3>
<issue4>
<name>Batman Eternal</name>
<author>Scott Synder</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue4>
<issue5>
<name>Batman Eternal</name>
<author>Scott Synder</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue5>
<issue6>
<name>Batman Eternal</name>
<author>Darren Darcer</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue6>
<issue7>
<name>Batman Eternal</name>
<author>Darren Darcer</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue7>
<issue8>
<name>Batman Eternal</name>
<author>Darren Darcer</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue8>
<issue9>
<name>Batman Eternal</name>
<author>Darren Darcer</author>
<publisher>DC Comics</publisher>
<country>USA</country>
<year>2012</year>
<price>$2.99</price>
</issue9>
</batman>
</comics>
@Tomalak - as you can see I am not getting it...
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="batman.xsl">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<table border="1">
<th><td>Name</td><td>Author</td><td>Publisher</td><td>Country</td><td>Year</td><td>Price</td></th>
<tr bgcolor="#ebebeb">
<th>name</th>
<th>author</th>
<th>publisher</th>
<th>country</th>
<th>year</th>
<th>price</th>
</tr>
<xsl:for-each select="comics/batman/issue">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="author"/></td>
<td><xsl:value-of select="publisher"/></td>
<td><xsl:value-of select="country"/></td>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="price"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>