cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reinhard Poetz" <reinhard_po...@gmx.net>
Subject RE: How to remove namespace declarations and prefixes?
Date Mon, 01 Jul 2002 11:02:05 GMT
Thank you for this solution.

- Do you know if this influences the performance?
- Is there a special reason why "exclude-result-prefixes" 
  doesn't work or is it a bug?

Regards,
Reinhard

> -----Original Message-----
> From: Manos Batsis [mailto:m.batsis@bsnet.gr]
> Sent: Monday, July 01, 2002 12:45 PM
> To: cocoon-users@xml.apache.org
> Cc: reinhard_poetz@gmx.net
> Subject: RE: How to remove namespace declarations and prefixes?
> 
> 
> Piece of cake. A stylesheet which does exactly that would is
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
>     <xsl:template match="*">
>       <!-- remove element prefix (if any) -->
>       <xsl:element name="{local-name()}">
>         <!-- process attributes -->
>         <xsl:for-each select="@*">
>           <!-- remove attribute prefix (if any) -->
>           <xsl:attribute name="{local-name()}">
>             <xsl:value-of select="."/>
>           </xsl:attribute>
>         </xsl:for-each>
>         <xsl:apply-templates/>
>       </xsl:element>
>   </xsl:template>
> </xsl:stylesheet>
> 
> However, adding another step in your pipeline may not be the best
> solution. You might want to modify your existing last stylesheet to
> remove prefixes using the local-name() function as above.
> 
> Hope this helps,
> 
> Manos

---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message