In this case, there's a problem with the body tag, opened in a template and
closed in another one.
There are also 3 (!) templates matching "guide"... It's useless, only the
1st or last one will be used (I don't remember if this is in the spec or
XSLT engine dependant)

I would advise you to use identation when writing templates. This kind of
error will be easier to track... (see discussion about xsl editing;
personnaly, I'm using cooktop -- it can also validate you stylesheets)

Also, don't expect too much of cocoon's error message: they're quite useless
as you can see here. Use a xml/xsl validator to find the right bug.

Olivier

> -----Message d'origine-----
> De : Kazi the P i R @ t {- [mailto:[EMAIL PROTECTED]]
> Envoyé : mardi 31 juillet 2001 06:24
> À : [EMAIL PROTECTED]
> Cc : [EMAIL PROTECTED]; Lim Huat Heng
> Objet : xsl transfromation.
> 
> 
> System: Win 98
> Servlet Engine: Tomcat (standalone) 3.2.1
> XML Framework: Cocoon 1.8.2
> Trouble:
> I was just trying out an xsl transformaiton of a static xml page i
> created... but then when i called the page from the browser 
> the following
> error comes up -
> 
> 'org.apache.cocoon.processor.ProcessorException: Could not associate
> stylesheet to document:  error reading
> C:\Tomcat\webapps\cocoon\newProd\guide-html.xsl:
> org.xml.sax.SAXParseException: The element type "xsl:template" must be
> terminated by the matching end-tag "</xsl:template>".'
> 
> I just checked the <xsl:template.. issue it mentions.. and it 
> appears that
> all the tags were closed properly.
> 
> The XSL file -
> 
> <?xml version="1.0" ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3c.org/1999/XSL/Transform";
> version="1.0">
> <html>
> <head>
> <title>A Guide to the Search Utility</title>
> </head>
> <body>
> <xsl:template match="guide">
> <xsl:processing-instruction
> name="cocoon-format">type="text/html"</xsl:processing-instruction>
> <table width="100%" border="0">
> <tr>
> <td>
> <xsl:apply-template select="buttons"/>
> </td>
> </tr>
> </table>
> </xsl:template>
> <xsl:template match="guide">
> <table width="100%" border="0">
> <tr>
> <td>
> <xsl:apply-template select="how-to"/>
> </td>
> </tr>
> </table>
> </xsl:template>
> <xsl:template match="guide">
> <table width="60%" border="0" align="center" valign="middle">
> <tr>
> <td>
> <xsl:apply-template select="contact"/>
> </td>
> </tr></table>
> </body>
> </html>
> </xsl:template>
> <xsl:template match="buttons">
> <xsl:for-each select="buttons[*]"><p><img border="0" align="left"
> valign="middle">
> <xsl:attribute name="src"><xsl:value-of 
> select="image"/></xsl:attribute>
> </img>
> <xsl:vlaue-of select="text"/></p>
> </xsl:for-each>
> </xsl:template>
> <xsl:template match="how-to">
> <p>
> <xsl:apply-template select="description"/>
> </p>
> </xsl:template>
> <xsl:template match="description">
> <ol>
> <xsl:for-each select=".">
> <li>
> <xsl:value-of select="."/>
> <xsl:apply-template select="sub-point"/>
> </li>
> </xsl:for-each>
> </ol>
> </xsl:template>
> <xsl:template match="subpoint">
> <ul>
> <xsl:value-of select="."/>
> </ul>
> </xsl:template>
> <xsl:template match="contact">
> <p><xsl:text>form more information contact the person 
> below:</xsl:text></p>
> <p>
> <b><xsl:value-of select="name"/></b>
> </p>
> <p>
> <b><xsl:value-of select="email"/></b>
> </p>
> </xsl:template>
> </xsl:stylesheet>
> 
> My DTD -
> 
> <!ELEMENT guide (buttons,how-to,contact)>
> <!ELEMENT buttons (search,view,sort,warning,respond)>
> <!ELEMENT how-to (description+)>
> <!ELEMENT contact (name,email)>
> <!ELEMENT search (text, image)>
> <!ELEMENT view (text,image)>
> <!ELEMENT sort (text,image)>
> <!ELEMENT warning (text,image)>
> <!ELEMENT respond (text,image)>
> <!ELEMENT text (#PCDATA)>
> <!ELEMENT image (#PCDATA)>
> <!ELEMENT description (#PCDATA|sub-point)*>
> <!ELEMENT sub-point (#PCDATA)>
> <!ELEMENT name (#PCDATA)>
> <!ELEMENT email (#PCDATA)>
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
> 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to