jon         00/11/22 13:54:03

  Modified:    examples/anakia/xdocs/stylesheets site.vsl
  Log:
  show how to process individual tags...this is VERY similar to the
  <xsl:template match="img"> functionality except it works better cause
  we now have the ability to properly handle relative paths. this is
  exactly why i dumped XSL in the first place.
  
  Revision  Changes    Path
  1.2       +13 -3     jakarta-velocity/examples/anakia/xdocs/stylesheets/site.vsl
  
  Index: site.vsl
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/examples/anakia/xdocs/stylesheets/site.vsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- site.vsl  2000/11/22 19:36:46     1.1
  +++ site.vsl  2000/11/22 21:54:02     1.2
  @@ -34,14 +34,24 @@
               #set $sections = $root.getChild("body").getChildren("section")
               #foreach ( $sec in $sections )
                   #set $data = $sec.getChildren()
  -                #foreach ( $item in $data )
  -                    $xmlout.outputString($item)
  +                #foreach ( $item in $data )                
  +                    #if ($item.getName().equals("img"))
  +                        #image ($item)
  +                    #else
  +                        $xmlout.outputString($item)
  +                    #end
                   #end
               #end
           </body>
       </html>
   #end
  -    
  +
  +#macro ( image $value )
  +    <img src="$relativePath$value.getAttributeValue("src")">
  +#end
  +#macro ( projectanchor $value )
  +    <a href="$relativePath$value.getAttributeValue("href")">
  +#end
   #macro ( metaauthor $author $email )
               <meta name="author" value="$author">
               <meta name="email" value="$email">
  
  
  

Reply via email to