cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Roebuck <stuart.roeb...@adolos.co.uk>
Subject Re: XSL Problems (off topic)
Date Wed, 20 Dec 2000 11:52:54 GMT
Matthew,

The problem is that you you have two templates that match against the "HTML" tag:

	match="*|/"
and
	match="html"

Some XSLT Transformers will just use one or the other.  Some will issue an error.

You need to use the priority="value" attribute on your template to give the first match a
lower priority than the second.

Stuart.

P.S. I have a feeling that you should have posted this to "cocoon-users" rather than "cocoon-dev".


On Wednesday, December 20, 2000, at 09:54 AM, Matthew Langham wrote:

> Hi XSL gurus, 
>  
> Sorry - off topic but I really am stuck. 
>  
> I am stuck on a Stylesheet problem - perhaps someone with more XSL karma can 
> give me a hint what is wrong. 
>  
> Using the org.apache.cocoon.generation.HTMLGenerator I get the following 
> XML: 
>  
> >>> 
> <?xml version="1.0" encoding="UTF-8"?> 
> <html><head> 
> <meta name="generator" content="HTML Tidy, see www.w3.org"/> 
> <meta name="robots" content="noindex"/> 
> <script type="text/javascript" language="JavaScript" xml:space="preserve"> 
>  
> </script> 
>  
> <title/> 
> </head><body text="000000" bgcolor="c0c0c0"> 
> <form method="get" enctype="application/x-www-form-urlencoded"> 
> <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
> <tr valign="top"> 
> <<< 
>  
> Now I want to write a stylesheet to manipulate the XHTML. My test-stylesheet 
> looks like this: 
>  
> >> 
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
>  
> <xsl:template match="*|/"><xsl:apply-templates/></xsl:template> 
>  
> <xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

>  
> <xsl:template match="html"> 
> <html> 
> <body> 
> <b> 
> <xsl:apply-templates/> 
> </b> 
> </body> 
> </html></xsl:template> 
>  
> </xsl:stylesheet> 
> << 
>  
> So basically I just want to match on the incoming "html" tag and then do 
> something. This stylesheet works fine when I test the whole thing in 
> Execelon Stylus - however not in Cocoon! Everything is configured ok - but 
> the match="html" is never triggered! Any ideas? 
>  
> Matthew 
>  


-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Lead Developer                                  Mac OS X, Java, XML, etc.
ADOLOS                                             http://www.adolos.com/
Mime
View raw message