Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- xmlns:ns="http://www.dei.isep.ipp.pt/lprog">
- <xsl:output method="html"/>
- <xsl:template match="/ns:relatório">
- <html>
- <head>
- <title>
- <xsl:value-of select="//ns:tema"/>
- </title>
- <link rel="stylesheet" type="text/css" href="estilo.css" />
- </head>
- <body style="margin-left: 7%; margin-right: 5%; font-family: arial; font-size: 12pt; background: #cce0ff">
- <xsl:apply-templates select="ns:páginaRosto"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Alunos</h2>
- </center>
- <xsl:apply-templates select="//ns:autor"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Indice</h2>
- </center>
- <xsl:apply-templates select="//ns:corpo"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Introdução</h2>
- </center>
- <xsl:apply-templates select="//ns:introdução"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Análise</h2>
- </center>
- <xsl:apply-templates select="//ns:análise"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Linguagem</h2>
- </center>
- <xsl:apply-templates select="//ns:linguagem"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Transformações</h2>
- </center>
- <xsl:apply-templates select="//ns:transformações"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Conclusão</h2>
- </center>
- <xsl:apply-templates select="//ns:conclusão"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Bibliografia</h2>
- </center>
- <xsl:apply-templates select="//ns:referências"/>
- <br></br>
- <hr></hr>
- <br></br>
- <center>
- <h2>Anexos</h2>
- </center>
- <xsl:apply-templates select="//ns:anexos"/>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="ns:páginaRosto">
- <center>
- <xsl:element name="img">
- <xsl:attribute name="src">
- <xsl:value-of select="ns:logotipoDEI"/>
- </xsl:attribute>
- <xsl:attribute name="heigth">400</xsl:attribute>
- <xsl:attribute name="width">400</xsl:attribute>
- </xsl:element>
- <xsl:apply-templates select="//ns:disciplina"/>
- <br></br>
- <h3>
- <xsl:value-of select="ns:tema"/>
- </h3>
- <br></br>
- <br></br>
- <b>Turma: </b>
- <xsl:value-of select="ns:turma"/>
- <br></br>
- <br></br>
- <b>Docentes:</b>
- <br></br>
- <xsl:apply-templates select="ns:professor"/>
- <br></br>
- <xsl:value-of select="ns:data"/>
- </center>
- </xsl:template>
- <xsl:template match="ns:disciplina">
- <br></br>
- <h2>
- <xsl:value-of select="ns:designação"/> -
- <xsl:value-of select="ns:sigla"/>
- </h2>
- </xsl:template>
- <xsl:template match="ns:professor">
- <br>
- <xsl:value-of select="@sigla"/> -
- <xsl:value-of select="@tipoAula"/>
- </br>
- </xsl:template>
- <xsl:template match="ns:autor">
- <center>
- <xsl:value-of select="ns:nome"/> -
- <xsl:value-of select="ns:número"/> -
- <xsl:value-of select="ns:mail"/>
- </center>
- <br></br>
- </xsl:template>
- <xsl:template match="ns:corpo">
- <center>
- <h3>
- <xsl:value-of select="ns:introdução/@tituloSecção"/>
- </h3>
- <xsl:apply-templates select="ns:outrasSecções"/>
- <h3>
- <xsl:value-of select="ns:conclusão/@tituloSecção"/>
- </h3>
- <h3>
- <xsl:value-of select="ns:referências/@tituloSecção"/>
- </h3>
- <h3>
- <xsl:value-of select="//ns:anexos/@tituloSecção"/>
- </h3>
- </center>
- </xsl:template>
- <xsl:template match="ns:outrasSecções">
- <center>
- <h3>
- <xsl:value-of select="ns:análise/@tituloSecção"/>
- </h3>
- <h3>
- <xsl:value-of select="ns:linguagem/@tituloSecção"/>
- </h3>
- <h3>
- <xsl:value-of select="ns:transformações/@tituloSecção"/>
- </h3>
- </center>
- </xsl:template>
- <xsl:template match="ns:introdução">
- <p style="text-align: justify; padding-left: 5%; padding-reight: 5%">
- <xsl:for-each select="ns:parágrafo">
- <p>
- <xsl:value-of select="."/>
- </p>
- </xsl:for-each>
- </p>
- </xsl:template>
- <xsl:template match="ns:análise">
- <p style="text-align: justify; padding-left: 5%; padding-reight: 5%">
- <xsl:for-each select="ns:parágrafo">
- <p>
- <xsl:value-of select="."/>
- </p>
- </xsl:for-each>
- </p>
- </xsl:template>
- <xsl:template match="ns:linguagem">
- <br></br>
- <xsl:if test="./*=ns:parágrafo">
- <p style="text-align: justify; padding-left: 5%; padding-reight: 5%">
- <p>
- <xsl:value-of select="."/>
- </p>
- </p>
- </xsl:if>
- <br></br>
- <br></br>
- <xsl:if test="./*=ns:codigo">
- <p style="text-align: justify; padding-left: 5%; padding-reight: 5%">
- <p>
- <xsl:value-of select="ns:bloco"/>
- </p>
- </p>
- </xsl:if>
- </xsl:template>
- <xsl:template match="ns:transformações">
- <p style="text-align: justify; padding-left: 5%; padding-reight: 5%">
- <xsl:for-each select="ns:parágrafo">
- <p>
- <xsl:value-of select="."/>
- </p>
- </xsl:for-each>
- </p>
- </xsl:template>
- <xsl:template match="ns:conclusão">
- <p style="text-align: justify; padding-left: 5%; padding-reight: 5%">
- <xsl:for-each select="ns:parágrafo">
- <p>
- <xsl:value-of select="."/>
- </p>
- </xsl:for-each>
- </p>
- </xsl:template>
- <xsl:template match="ns:referências">
- <xsl:apply-templates select="ns:refWeb"/>
- </xsl:template>
- <xsl:template match="ns:refWeb">
- <xsl:value-of select="ns:URL"/> -
- <xsl:value-of select="ns:descrição"/>
- <br></br>
- </xsl:template>
- <xsl:template match="ns:anexos">
- <center>
- <xsl:for-each select="ns:figura">
- <xsl:element name="img">
- <xsl:attribute name="src">
- <xsl:value-of select="@src"/>
- </xsl:attribute>
- <xsl:attribute name="heigth">300</xsl:attribute>
- <xsl:attribute name="width">300</xsl:attribute>
- </xsl:element>
- <p>
- <xsl:value-of select="@descrição"/>
- </p>
- <br></br>
- <br></br>
- </xsl:for-each>
- </center>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement