You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Donald Ball <ba...@webslingerZ.com> on 2000/02/19 22:34:08 UTC

Re: XSLTProcessor Problem in Cocoon 1.6

On Sat, 19 Feb 2000, Pablo Bellver wrote:

> I 've been developing some xml and xsl pages with cocoon 1.5.  I am using
> the stylesheets (xsl files) to generate the html output of my xml pages.
> I recently moved to cocoon 1.6 and try to reuse my xml and xsl pages but I
> started to get errors from the XSLTProcessor. It complains about missing
> tags in the html embedded in the xsl file.
> 
> For example
> 
> "org.apache.cocoon.processor.ProcessorException: Could not associate
> stylesheet to document:  error reading /home/cocoon/paginas/avanzado.xsl:
> The element type "meta" must be terminated by the matching end-tag "".
> 
> The strange thing is that if I use the same stylesheet on Cocoon 1.5 it runs
> perfect.
> I realized that cocoon 1.5 used the XSLPProcessor to process the stylesheets
> and Cocoon1.6 uses the XSLTProcessor to process the stylesheets. But I
> thought that I could reuse my xml and xsl files with no changes at all from
> cocoon 1.5 to cocoon 1.6.

That's not necessarily the case. XSL:P, the default processor in
cocoon-1.5, supported an early working draft of the XSLT spec. Xalan, the
default in 1.6, supports the final draft of the XSLT spec. Things did
change between the two, though not a _huge_ number of things. The main
difference is that Xalan is more picky (and correct) than XSL:P.

> I also don't understand why the XSLTProcessor is complaining about the
> missing html tags.  Because one of the main differences between html and xml
> is that  the opening and closing tags in html are not always enforced. That
> means that an html file does not guarantee that for each opening tag you
> have a closing tag. So my assumption is that the stylesheet processor was
> dealing with that (at least that seemed to be the behavior of the cocoon 1.5
> XSLPProcessor).
> Does anyone have experimented the same problems?
> Do I need to recode the html inside the xsl files if I move from cocoon 1.5
> to cocoon 1.6?

Your XSLT stylesheet _must_ be well-formed XML, therefore the non-XSLT
tags inside it must be well-formed XML. <br>'s must be written as <br/>,
<html> must be balanced by </html>, etc. AFAIK, it _is_ possible to create
non-XML output, but you must do so by creating literal result elements
using xsl:element. What you oughta do is download a copy of tidy and run
it against your stylesheets (tidy -e -xml foo.xsl).

- donald