You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by do...@cocoon.apache.org on 2004/07/14 17:01:18 UTC

[Cocoon Wiki] New: XfolioDebugSerializer

   Date: 2004-07-14T08:01:18
   Editor: FredericGlorieux <fr...@xfolio.org>
   Wiki: Cocoon Wiki
   Page: XfolioDebugSerializer
   URL: http://wiki.apache.org/cocoon/XfolioDebugSerializer

   no comment

New Page:

[[TableOfContents([3])]]
(c) 2003, 2004 xfolio.org, ajlsm.com, strabon.org. Licence :
[http://www.gnu.org/copyleft/gpl.html GPL]

= What =

You want the lighter debug solution of a pipeline ?
Try the "debug" serializer.

= Who =
 *[[Anchor(FG)]] FG: -- FredericGlorieux 

= How =

Insert/Delete it everywhere in your pipe (for now this bad practice is not yet 
forbid by cocoon) like that
{{{
<map:match="**">
  <map:generate ...>
  <map:transform ...>
  <map:transform ...>
  <!-- till here it works -->
  <map:transform ...>

  <!-- this step don't send what I need, lets serialize now to see what there is  -->
  <map:serialize type="debug">

  <map:transform ...>
  <map:transform ...>
  <map:serialize ...>
</map:match>
}}}

What is it ? Nothing more than a default XML serializer to declare, with some simple 
parameters to precise. '''Never read it in the doc, but found it in the code''' : the XML 
serializer use your default xsl engine to get text from SAX events.

{{{
<map:serializer name="debug" mime-type="text/plain" src="org.apache.cocoon.serialization.XMLSerializer">
  <indent>yes</indent>
</map:serializer>
}}}

 * Take note of this detail, the sended mime-type to the browser is "text-plain". Why ? Have you ever try to 
view a one Mo xml file in your browser ? By server or client, it's always an XSL transform to HTML "pretty-view", expensive. Also, usually you need to verify the source to check <![CDATA[ ]]>, &entities;, or xmlns="" declarations.

 * And about indent option, it's a bit like in your XSL when you precise  {{{<xsl:output method="xml" indent="yes" encoding="UTF-8" doctype-public="" doctype-system="" .../>}}}, you have your quite pretty view, depending on your XSL engine (Saxon do good work on that), but without colors.


= Changes =
  * [[Date(2004-07-14T15:01:17Z)]]:[#FG] Creation


= References =

[http://www.w3.org/TR/xslt#output xsl:output]

= See also =
## pages which cite this one
[[FullSearch()]]
## pages with some important concepts in their title
[[PageList(debug)]]
[[PageList(xfolio)]]