Re: XSLT in Mozilla

Fabrice Desré <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Le Tue, 06 Dec 2005 20:19:22 -0800, meena.shah a écrit :


> 
> i have no idea why it doesn't seem to apply the templates in mozilla...
> anyone have an idea what i'm doing wrong here?

In your document, StatsReports is in the "schema:StatsReportSchema.xml"
namespace. Thus you need to declare a prefix to this namespace URI to
select these nodes with xpath. This will work :

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns="http://www.w3.org/1999/xhtml/"
                xmlns:ns1="schema:StatsReportSchema.xml">
<xsl:output method="html">

<!-- Root template -->
<xsl:template match="/">
	<html>
		<head>
			<title>Node Statistics</title>
			<link href="StatsReport2.css" type="text/css" rel="stylesheet"/>
		</head>
		<body>
			test2<br/>
			<xsl:apply-templates select="ns1:StatsReport"/><br/> test3
		</body>
	</html>
</xsl:template>

<!-- StatsReport template -->
<xsl:template match="ns1:StatsReport">
	<b>test?</b>
</xsl:template>
<./xsl:stylesheet>

 HTH,

   Fabrice
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.