cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BURGHARD √Čric <>
Subject XSLSerializer, XSLGenerator, XSLReader
Date Mon, 20 Jun 2005 16:17:42 GMT

By looking at the XMLSerializer source code, i just realized that the
serialization was driven in fact by an xsl transformation (with no
stylesheet). So i wondered, why not giving this serialization a real
stylesheet ? That way i could overcome all the limitations of the actual

I quickly hack the file, and end up with the XSLSerializer.

The main advantages are
- i can get rid of namespaces without another step
- generate real xhtml (dispite the name the actual xhtml transformer
contract all empty tags like textarea, div, script, ..., which makes all
browsers really mad)
- use directly all xslt2.0 serialization enhancements (character-maps) with
- perhaps performance improvement, because the stylesheet is precompiled and
reused with the component, and because we save one step in the pipeline
(even if a plain serialization should be really fast). The stylesheet is
XSL precompiled, whereas with conventional pipeline and cache activated,
only its structure is precompiled (SAX).

For now, i configure the serializer with a

and use it with no parameters, but why not a

<map:serializer type="xslt" src="path_of_the_stylesheet">
  <map:parameter name="cpath" value={contextpath:}

to absolutise path, delete namespaces, change &and; to & (for javascript
snippets), and serialize to xhtml (method=xhtml) all in one step ?

By extension, why not having an XSLGenerator and an XSLReader ?


View raw message