taylor      2002/12/17 23:05:50

  Added:       webapp/xml footballers.xml footballers.xsl
  Log:
  for the XSLPortlet demo portlet. The generated HTML is a little sloppy, sorry, 
limited time.
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed/webapp/xml/footballers.xml
  
  Index: footballers.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <footballers>
  <player>
  <firstname>Cobi</firstname>
  <lastname>Jones</lastname>
  <position>Midfielder</position>
  <caps>150</caps>
  <goals>24</goals>
  <country>USA</country>
  </player>
  <player>
  <firstname>Zbigniew</firstname>
  <lastname>Boniek</lastname>
  <position>Midfielder</position>
  <caps>80</caps>
  <goals>24</goals>
  <country>Poland</country>
  </player>
  </footballers>
  
  
  
  1.1                  jakarta-jetspeed/webapp/xml/footballers.xsl
  
  Index: footballers.xsl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
  
  <xsl:template match="footballers">
        <html>
                <head>
                        <title>
                        Footballers
                        </title>
                </head>
                <body>
                
                        <xsl:for-each select="player">
                                <table>
                                <tr>
                                <td>
                                <h2>
                                        <xsl:value-of select="firstname"/>
                                </h2>
                                </td>                                   
                                <td>    
                                <h2>
                                        <xsl:value-of select="lastname"/>              
                         
                                </h2>                                   
                       </td>                                    
                      </tr>                                     
                                </table>                                        
                                <table width="70%">
                                        <tr valign="top">
                                                <td width="60%">
                                                </td>
                                                <td width="40%">
                                                        <table>
                                                                <tr>
                                                                        <td>
                                                                                
<b><small>Caps:</small></b>
                                                                        </td>
                                                                        <td>
                                                                                
<xsl:value-of select="caps"/>
                                                                        </td>
                                                                </tr>
                                                                <tr>
                                                                        <td>
                                                                                
<b><small>Goals</small></b>
                                                                        </td>
                                                                        <td>
                                                                                
<xsl:value-of select="goals"/>
                                                                        </td>
                                                                </tr>
                                                                <tr>
                                                                        <td>
                                                                                
<b><small>Position:</small></b>
                                                                        </td>
                                                                        <td>
                                                                                
<xsl:apply-templates select="position"/>
                                                                        </td>
                                                                        <td>
                                                                                
<b><small>Country:</small></b>
                                                                        </td>          
                                                         
                                                                        <td>
                                                                                
<xsl:apply-templates select="country"/>
                                                                        </td>          
                                                         
                                                                </tr>
                                                        </table>
                                                </td>
                                        </tr>
                                </table>
                        </xsl:for-each>
  
              </body>
          </html>               
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to