You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Miles Elam <mi...@pcextremist.com> on 2003/01/08 08:26:35 UTC

Output beautifier

Hi all,

I'm looking for a way to neatly indent and otherwise clean up the output 
of a XSLT transformation, but the usual method of

  <xsl:output method="xml" version="1.0" indent="yes"/>
  <xsl:strip-space elements="*"/>

does not appear to work when used with Cocoon.  I also want a easy way 
of stripping all namespace declarations from the output except for

  xmlns="http://www.w3.org/1999/xhtml"

so that the output document will validate according to the W3C DTDs.  As 
it stands, other namespaces that are used in intermediate parts of the 
pipeline stick around despite the fact that no element in the output 
document belongs to those namespaces.

All of the examples I have come across from Google and other resources 
point me back to the same items which don't seem to work from within the 
Cocoon framework.  I'd be thankful for any pointers you could give me.

- Miles



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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Output beautifier

Posted by Miles Elam <mi...@pcextremist.com>.
Luca Morandini wrote:

>1) have you checked your XML serializer declaration has the "indent" element set to "yes" ? If it is set to "no", the indenting is stripped off while serializing
>
>2) You should use the "exclude-result-prefixes" attribute of your "xsl:stylesheet" element to get rid of those unwanted namespaces
>
>Best regards,
>
Best regards to you.  This was exactly what I was looking for.  Thank you.

And thank you Arjé for that Wiki reference.

- Miles



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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Output beautifier

Posted by Luca Morandini <lu...@tin.it>.
Miles,

1) have you checked your XML serializer declaration has the "indent" element set to "yes" ? If it is set to "no", the indenting is stripped off while serializing

2) You should use the "exclude-result-prefixes" attribute of your "xsl:stylesheet" element to get rid of those unwanted namespaces

Best regards,

--------------------------------------------- 
               Luca Morandini 
               GIS Consultant 
              lmorandini@ieee.org 
http://utenti.tripod.it/lmorandini/index.html 
---------------------------------------------
 

> -----Original Message-----
> From: Miles Elam [mailto:miles@pcextremist.com]
> Sent: Wednesday, January 08, 2003 8:27 AM
> To: cocoon-users
> Subject: Output beautifier
> 
> 
> Hi all,
> 
> I'm looking for a way to neatly indent and otherwise clean up the output 
> of a XSLT transformation, but the usual method of
> 
>   <xsl:output method="xml" version="1.0" indent="yes"/>
>   <xsl:strip-space elements="*"/>
> 
> does not appear to work when used with Cocoon.  I also want a easy way 
> of stripping all namespace declarations from the output except for
> 
>   xmlns="http://www.w3.org/1999/xhtml"
> 
> so that the output document will validate according to the W3C DTDs.  As 
> it stands, other namespaces that are used in intermediate parts of the 
> pipeline stick around despite the fact that no element in the output 
> document belongs to those namespaces.
> 
> All of the examples I have come across from Google and other resources 
> point me back to the same items which don't seem to work from within the 
> Cocoon framework.  I'd be thankful for any pointers you could give me.
> 
> - Miles
> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 


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

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>