Miles,

I would suggest using the XSL transformation that we always use to remove the 
namespaces:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:template match="*">
                <xsl:element name="{local-name()}">
                        <xsl:apply-templates select="@*|node()"/>
                </xsl:element>
        </xsl:template>
        <xsl:template match="@*|comment()">
                <xsl:copy/>
        </xsl:template> 
</xsl:stylesheet>

To get the indenting right, use the following XML serializer definition:

<map:serializers default="xml">
        <map:serializer logger="sitemap.serializer.xml" mime-type="text/xml" 
name="xml" src="org.apache.cocoon.serialization.XMLSerializer">
                <omit-xml-declaration>true</omit-xml-declaration>
                <encoding>UTF-8</encoding>
                <indent>1</indent>
        </map:serializer>
</map:serializers>

For more information, take a look at some of the Cocoon Wiki pages:
http://wiki.cocoondev.org/Wiki.jsp?page=RemoveNamespaces

Regards,

Arjé Cahn


---------------------------------------------------------
Content Management Department
Hippo Webworks
Grasweg 35
1031 HW Amsterdam
The Netherlands
Tel  +31 (0)20 6345173 
Fax +31 (0)20 6345179
arje(at)hippo(dot)nl / www.hippo.nl




-----Original Message-----
From: Luca Morandini [mailto:[EMAIL PROTECTED]]
Posted At: 08 January 2003 10:12
Posted To: Cocoon User List
Conversation: Output beautifier
Subject: RE: Output beautifier


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 
              [EMAIL PROTECTED] 
http://utenti.tripod.it/lmorandini/index.html 
---------------------------------------------
 

> -----Original Message-----
> From: Miles Elam [mailto:[EMAIL PROTECTED]]
> 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:     <[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/faq/index.html>

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



Reply via email to