You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2003/12/04 18:01:21 UTC

cvs commit: cocoon-lenya/src/webapp/lenya/xslt linkRewrite.xsl

gregor      2003/12/04 09:01:21

  Modified:    src/webapp/lenya/pubs/default/config/tasks targets.xml
  Added:       src/webapp/lenya/xslt/util linkRewrite.xsl
  Removed:     src/webapp/lenya/xslt linkRewrite.xsl
  Log:
  stray xsl is back where it belongs
  
  Revision  Changes    Path
  1.22      +1 -1      cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/targets.xml
  
  Index: targets.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/default/config/tasks/targets.xml,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- targets.xml	24 Nov 2003 17:25:49 -0000	1.21
  +++ targets.xml	4 Dec 2003 17:01:21 -0000	1.22
  @@ -613,7 +613,7 @@
       <taskdef name="linkRewrite" classname="org.apache.lenya.cms.ant.LinkRewriteTask"/>
       
       <linkRewrite baseDir="${pub.dir}/${authoring.dir}"
  -      stylesheet="${pub.dir}/../../xslt/linkRewrite.xsl"
  +      stylesheet="${pub.dir}/../../xslt/util/linkRewrite.xsl"
         area="${authoring.area}"
         oldDocumentId="${node.firstdocumentid}"
         newDocumentId="${node.newdocumentid}"/>
  
  
  
  1.1                  cocoon-lenya/src/webapp/lenya/xslt/util/linkRewrite.xsl
  
  Index: linkRewrite.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  
  <!-- $Id: linkRewrite.xsl,v 1.1 2003/12/04 17:01:21 gregor Exp $ -->
  
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    exclude-result-prefixes="xhtml"
    >
  
    <xsl:param name="idbefore"/>
    <xsl:param name="idafter"/>
    
    <xsl:template match="xhtml:a">
      <xsl:variable name="href">
        <xsl:choose>
  	<xsl:when test="@href=$idbefore">
  	  <xsl:value-of select="$idafter"/>
  	</xsl:when>
  	<xsl:otherwise>
  	  <xsl:value-of select="@href"/>
  	</xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <a href="{$href}">
        <xsl:apply-templates select="@*[not(local-name()='href')]|node()"/>
      </a>
    </xsl:template>
  
    <xsl:template match="@*|node()" priority="-1">
      <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org