AW: [xsl] Template priority

Subject: AW: [xsl] Template priority
From: "Heinz R., ITS P E320, TR" <R.Heinz@xxxxxxxxxxxxxxx>
Date: Thu, 21 Dec 2000 12:07:30 +0100
> Von: David Carlisle [mailto:davidc@xxxxxxxxx]
> > I override the built-in templates. But when I do this, my included
> > templates from util-html.xsl never match.
> 
> you missed out all the important information: How did you override the
> templates. 

Sorry.

The XML-Data:
***************** foo.xml *******************
<?xml version="1.0" encoding="ISO-8859-1"?>
<page>
	<should_match_with_util-html/>
	<should_match_with_foo-html>
		<should_match_with_foo-html_2/>
		<should_never_match_1/>		
		<should_match_with_foo-html_3/>
		<should_never_match_2/>		
	</should_match_with_foo-html>
</page>
**********************************************

should be processed with:
*********** foo-html.xsl **************************
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	xmlns="http://www.w3.org/TR/REC-html40";
>
	<xsl:import href="./util/util-html.xsl"/>

	<!-- override default rules -->
	<xsl:template match="*|@*|text()">
		   <xsl:apply-templates />
	</xsl:template>

	<!-- ROOT -->
	<xsl:template match="page">
		<html>
		<head>[...]</head>
		<body>
			<xsl:apply-templates/> 
		</body>
		</html>
	</xsl:template>

	[ Templates for elements which should produce html output following ]
	[...]
</xsl:stylesheet>
*******************************************************

My reusable templates:
*********** util-html.xsl **************************
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
	xmlns="http://www.w3.org/TR/REC-html40";
>
	<!-- should match before "*|@*|text()" from foo-html.xsl -->
	<xsl:template match="should_match_with_util-html">
		<b>Hello World</b>
	</xsl:template>
</xsl:stylesheet>
****************************************************

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread