jefft 2003/05/18 03:21:40
Modified: . status.xml
src/resources/stylesheets filterlinks.xsl
Log:
Rewrite filterlinks to make it more understandable, and add an exclusion for
links to local directories, which the Cocoon CLI blows up on
Revision Changes Path
1.160 +3 -0 xml-forrest/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/xml-forrest/status.xml,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -r1.159 -r1.160
--- status.xml 13 May 2003 01:15:12 -0000 1.159
+++ status.xml 18 May 2003 10:21:39 -0000 1.160
@@ -24,6 +24,9 @@
<changes>
<release version="0.5-dev" date="unreleased">
+ <action dev="JT" type="fix" context="core">
+ Links to subdirectories no longer blow up the command-line rendering.
+ </action>
<action dev="JT" type="update" context="shbat">
The 'backcopy' command will now copy all types of custom content
(*.xmap, skinconf.xml, xdocs, images, stylesheets, DTDs).
1.7 +26 -10 xml-forrest/src/resources/stylesheets/filterlinks.xsl
Index: filterlinks.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/filterlinks.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- filterlinks.xsl 27 Apr 2003 08:39:38 -0000 1.6
+++ filterlinks.xsl 18 May 2003 10:21:40 -0000 1.7
@@ -15,18 +15,34 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
- <xsl:param name="ctxbasedir"/>
+ <xsl:param name="ctxbasedir" select="'undefined'"/>
<xsl:template match="@src|@href|@background">
- <!-- The ctxbasedir condition prevents the absolute image paths used in PDFs
- from being rendered. It will go away when FOP improves -->
- <xsl:if test="not(starts-with(., $ctxbasedir)) and
- not(contains(.,'apidocs')) and
- not(starts-with(., 'api/'))">
- <xsl:copy>
- <xsl:apply-templates select="."/>
- </xsl:copy>
- </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="starts-with(., $ctxbasedir)">
+ <xsl:message>Ignoring absolute PDF link: <xsl:value-of select="."/></xsl:message>
+ <!-- Ignore absolute image paths used in PDFs from being rendered. This
+ will go away when the FOP-Cocoon link improves -->
+ </xsl:when>
+ <xsl:when test="contains(., 'apidocs')">
+ <xsl:message>Ignoring javadoc link: <xsl:value-of select="."/></xsl:message>
+ <!-- Ignore refs to Javadocs (links containing 'apidocs') -->
+ </xsl:when>
+ <xsl:when test="contains(., 'api/')">
+ <xsl:message>Ignoring javadoc link: <xsl:value-of select="."/></xsl:message>
+ <!-- Ignore refs to Javadocs ('api/' prefix) -->
+ </xsl:when>
+ <xsl:when test="not(contains(., ':')) and substring(., string-length(.)) = '/'">
+ <xsl:message>Ignoring directory link: <xsl:value-of select="."/></xsl:message>
+ <!-- Don't try to render links to local directories (that end with '/'). -->
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates select="."/>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="@*|node()">
|