(XSL) Simple XML Output - Help Needed!
Hi guys,
I'm in the process of learning about XML/XSL and am having trouble outputting some XML onto a simple XSL page. The two pages are shown below (condensed to the important parts):
XML File
Code:
<?xml version='1.0' encoding='ISO-8859-9'?>
<?xml-stylesheet type="text/xsl" href="ServiceInformation.xsl"?>
<TVAMain xmlns='urn:tva:metadata:2005' xmlns:mpeg7='urn:tva:mpeg7:2005' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xml:lang='en'>
<ProgramDescription>
<ServiceInformationTable>
<ServiceInformation serviceId='BBCOne'>
<Name>BBC One</Name>
</ServiceInformation>
<ServiceInformation serviceId='BBCTwo'>
<Name>BBC Two</Name>
</ServiceInformation>
</ServiceInformationTable>
</ProgramDescription>
</TVAMain>
XSL File
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/css" href="assignment1.css"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bbc='urn:tva:metadata:2005' version="1.0">
<xsl:template match="/">
<xsl:apply-templates select="document('ServiceInformation.xml')/bbc:TVAMain/bbc:ProgramDescription/bbc:ServiceInformationTable"/>
</xsl:template>
<xsl:template match="bbc:ServiceInformationTable">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Page</title>
</head>
<body>
<div id="container">
<xsl:apply-templates select="bbc:ServiceInformation"/>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="bbc:ServiceInformation">
<xsl:value-of select="bbc:Name"/><br />
</xsl:template>
</xsl:stylesheet>
Any help/pointers would be greatly appreciated :D
Thanks,
Will