jcramalho

pr2html.xsl

Oct 6th, 2014
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.10 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet
  3.    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.    xmlns:xs="http://www.w3.org/2001/XMLSchema"
  5.    xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
  6.    exclude-result-prefixes="xs xd"
  7.    version="1.0">
  8.     <xd:doc scope="stylesheet">
  9.         <xd:desc>
  10.             <xd:p><xd:b>Created on:</xd:b> Oct 6, 2014</xd:p>
  11.             <xd:p><xd:b>Author:</xd:b> jcr</xd:p>
  12.             <xd:p>Exercíco da aula3 de PRI2014</xd:p>
  13.         </xd:desc>
  14.     </xd:doc>
  15.    
  16.     <xsl:output method="html" indent="yes"/>    
  17.    
  18.     <xsl:template match="/">
  19.         <html>
  20.             <head>
  21.                 <title>Project record</title>
  22.             </head>
  23.             <body>
  24.                 <center><h1>Project Record</h1></center>
  25.                 <hr/>
  26.                 <table width="100%">
  27.                     <tr>
  28.                         <td width="50%">
  29.                             <b>KEY-NAME: </b>
  30.                             <xsl:value-of select="project-record/meta/key-name"/> <br/>
  31.                            
  32.                             <b>TITLE: </b>
  33.                             <xsl:value-of select="project-record/meta/title"/> <br/>
  34.                            
  35.                             <b>SUBTITLE: </b>
  36.                             <xsl:value-of select="project-record/meta/subtitle"/> <br/>
  37.                         </td>
  38.                         <td width="50%">
  39.                             <b>BEGIN-DATE: </b>
  40.                             <xsl:value-of select="project-record/meta/begin-date"/> <br/>
  41.                            
  42.                             <b>END-DATE: </b>
  43.                             <xsl:value-of select="project-record/meta/end-date"/> <br/>
  44.                            
  45.                             <b>SUPERVISORS:</b>
  46.                             <xsl:apply-templates select="project-record/meta/supervisors"/>
  47.                             <br/>
  48.                         </td>
  49.                     </tr>
  50.                 </table>
  51.                
  52.                 <hr/>
  53.                 <hr/>
  54.                
  55.                 <xsl:apply-templates select="project-record/abstract"/>
  56.                
  57.             </body>
  58.         </html>
  59.     </xsl:template>
  60.    
  61.     <xsl:template match="abstract">
  62.         <h3>Abstract</h3>
  63.         <xsl:apply-templates/>
  64.     </xsl:template>
  65.    
  66.     <xsl:template match="p">
  67.         <p>
  68.             <xsl:apply-templates/>
  69.         </p>
  70.     </xsl:template>
  71.    
  72.     <xsl:template match="b">
  73.         <b>
  74.             <xsl:apply-templates/>
  75.         </b>
  76.     </xsl:template>
  77.    
  78.     <xsl:template match="i">
  79.         <i>
  80.             <xsl:apply-templates/>
  81.         </i>
  82.     </xsl:template>
  83.    
  84.     <xsl:template match="supervisors">
  85.         <ul>
  86.             <xsl:apply-templates/>
  87.         </ul>
  88.     </xsl:template>
  89.    
  90.     <xsl:template match="supervisor">
  91.         <li>
  92.             <a href="{homepage}">
  93.                 <xsl:value-of select="name"/>
  94.             </a>,
  95.             <xsl:value-of select="email"/>
  96.         </li>
  97.     </xsl:template>
  98. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment