cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manos Batsis" <m.bat...@bsnet.gr>
Subject RE: How to remove namespace declarations and prefixes?
Date Mon, 01 Jul 2002 10:45:14 GMT
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



> -----Original Message-----
> From: Reinhard Poetz [mailto:reinhard_poetz@gmx.net] 
> Sent: Monday, July 01, 2002 1:31 PM
> To: cocoon-users@xml.apache.org
> Subject: How to remove namespace declarations and prefixes?
> 
> 
> I have to use a lot of namespaces and I want to remove them 
> at the last
> transformation step. I found several solutions but none of 
> them works for
> me:
> 
> exclude-result-prefixes (in the stylesheet)
> [http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=1001011653
25379&w=2]

<omit-xml-declaration> (in the sitemap)
[http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=100084611731795&w=2]

exclude-prefixes (in the stylesheet)
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=101912408904652&w=2


I use Cocoon2.1dev from last week, JDK_1.3.03 and Tomcat_4.01.


Regards,
Reinhard



---------------------------------------------------------------------
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>


---------------------------------------------------------------------
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