vgritsenko    2003/06/18 21:20:34

  Modified:    src/blocks/linotype/samples/stylesheets request2news.xslt
  Log:
  Remove unused r and h (request and xhtml) namespaces from the resulting document
  
  Revision  Changes    Path
  1.2       +16 -9     
cocoon-2.1/src/blocks/linotype/samples/stylesheets/request2news.xslt
  
  Index: request2news.xslt
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/linotype/samples/stylesheets/request2news.xslt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- request2news.xslt 17 Jun 2003 01:32:43 -0000      1.1
  +++ request2news.xslt 19 Jun 2003 04:20:32 -0000      1.2
  @@ -1,11 +1,11 @@
   <?xml version="1.0"?>
   
  -<xsl:stylesheet version="1.0" 
  - xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
  - xmlns:r="http://apache.org/cocoon/request/2.0"; 
  - xmlns:h="http://www.w3.org/1999/xhtml";
  - xmlns="http://www.w3.org/1999/xhtml";
  ->
  +<xsl:stylesheet version="1.0"
  +                xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  +                xmlns:r="http://apache.org/cocoon/request/2.0";
  +                xmlns:h="http://www.w3.org/1999/xhtml";
  +                xmlns="http://www.w3.org/1999/xhtml";
  +                exclude-result-prefixes="h r">
   
     <xsl:template match="/">
      <xsl:apply-templates select="//r:requestParameters"/>
  @@ -25,15 +25,22 @@
     <xsl:template match="h:b">
      <strong><xsl:apply-templates/></strong>
     </xsl:template>
  -  
  +
     <xsl:template match="h:i">
      <em><xsl:apply-templates/></em>
     </xsl:template>
  -      
  +
  +  <!-- This template filters out unnecessary declarations of the h namespace -->
  +  <xsl:template match="h:*">
  +   <xsl:element name="{name(.)}" namespace="http://www.w3.org/1999/xhtml";>
  +    <xsl:apply-templates select="node()|@*"/>
  +   </xsl:element>
  +  </xsl:template>
  +
     <xsl:template match="node()|@*">
      <xsl:copy>
       <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
     </xsl:template>
  -  
  +
   </xsl:stylesheet>
  
  
  

Reply via email to