forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/stylesheets wiki2document.xsl
Date Sun, 18 May 2003 12:28:06 GMT
jefft       2003/05/18 05:28:06

  Modified:    src/resources/stylesheets wiki2document.xsl
  Log:
  Add image for Wikis. Thanks to Luca Morandini
  
  Revision  Changes    Path
  1.8       +33 -4     xml-forrest/src/resources/stylesheets/wiki2document.xsl
  
  Index: wiki2document.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/wiki2document.xsl,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- wiki2document.xsl	28 Apr 2003 03:37:45 -0000	1.7
  +++ wiki2document.xsl	18 May 2003 12:28:06 -0000	1.8
  @@ -87,18 +87,33 @@
     <xsl:choose>
      <xsl:when test="contains(.,'|')">
   
  -    <xsl:variable name="href" select="substring-before(substring-after(.,'|'),']')"/>
       <xsl:variable name="text" select="substring-after(substring-before(.,'|'),'[')"/>
  +    <xsl:variable name="href" select="substring-before(substring-after(.,'|'),']')"/>
   
       <xsl:choose>
        <xsl:when test="string(number($href)) != 'NaN'">
         <link href="#{$href}">
          <xsl:value-of select="$text"/>
         </link>
  -     </xsl:when>
  -     <xsl:when test="starts-with($href,'http') or contains($href, '.html') or contains($href,
'.pdf')">
  +    </xsl:when>
  +
  +    <xsl:when test="contains($href, '.png') or
  +      contains($href, '.gif') or
  +      contains($href, '.jpeg') or
  +      contains($href, '.jpg')">
  +      <xsl:choose>
  +        <xsl:when test="contains($href, 'http://')">
  +          <img src="{$href}" alt="{$text}"/>
  +        </xsl:when>
  +        <xsl:otherwise>
  +          <img src="images/{$href}" alt="{$text}"/>
  +        </xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:when>
  +
  +    <xsl:when test="starts-with($href,'http') or contains($href, '.html') or contains($href,
'.pdf')">
         <link href="{$href}">
  -       <xsl:value-of select="$text"/>
  +        <xsl:value-of select="$text"/>
         </link>
        </xsl:when>
        <xsl:otherwise>
  @@ -113,6 +128,20 @@
       <xsl:variable name="href" select="substring(.,2,string-length(.)-2)"/>
       
       <xsl:choose>
  +      <xsl:when test="contains($href, '.png') or
  +        contains($href, '.gif') or
  +        contains($href, '.jpeg') or
  +        contains($href, '.jpg')">
  +        <xsl:choose>
  +          <xsl:when test="contains($href, 'http://')">
  +            <img src="{$href}" alt=""/>
  +          </xsl:when>
  +          <xsl:otherwise>
  +            <img src="images/{$href}" alt=""/>
  +          </xsl:otherwise>
  +        </xsl:choose>
  +      </xsl:when>
  +
        <xsl:when test="string(number($href)) != 'NaN'">
         <link href="#{$href}">
          [<xsl:value-of select="$href"/>]
  
  
  

Mime
View raw message