cheap nfl jerseys china cheap nfl jerseys free shipping wholesale nfl jerseys china wholesale jerseys from china cheap nfl jerseys free shipping cheap nfl jerseys for sale cheap jerseys free shipping wholesale nfl jerseys from china cheap nfl jerseys sale cheap nike nfl jerseys china wholesale jerseys free shipping cheap nfl jerseys wholesale wholesale nfl jerseys online cheap nfl jerseys wholesale china jerseys wholesale cheap coach handbags outlet authentic designer handbags cheap coach handbags outlet cheap coach purses outlet discount coach bags coach bags sale coach purse outlet cheap real coach purses coach handbags sale online coach purse outlet michael kors outlet online store cheap michael kors bags cheap michael kors purse michael kors factory outlet online cheap michael kors handbags cheap michael kors purses michael kors bags outlet online cheap michael kors purse michael kors handbags discount
XSL
XSL
eXtensible Stylesheet Language
eXtensible Stylesheet Language
per trasformare un file XML

XSL in breve

L'apertura e la chiusura del file XSL sono le seguenti:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
...
</xsl:stylesheet>
La struttura più usata, con la certezza di riprodurre tutto l'albero, consiste nell'aprire la radice, inserire i tag HTML, richiamare tutti i tempate definiti e chiudere l'HTML:

<xsl:template match="/">
<html><head><title>...</title></head><body><h1>...</h1>
<table><xsl:apply-templates /></table>
</body></html>

</xsl:template>

<xsl:template match="elemento">
<tr><td><xsl:value-of select="..." /></td></tr>
</xsl:template>
questo blocco viene ripetuto per ogni occorrenza dell'elemento citato.
Ecco come si visualizza un attributo (il titolo del secondo capitolo):

<xsl:template match="/libro/capitolo[position()=2]">
    <xsl:value-of select="@titolo"/>
</xsl:template>
Ed ecco come si può aggiungere testo e condizionarlo:

<xsl:template match="capitolo"> <h3>
    <xsl:if test="@tipo='bibliografia'">
        Bibliografia
    </xsl:if>
    <xsl:value-of select="@titolo"/> </h3>
<xsl:apply-templates/>
</xsl:template>

Ed ecco come si costruisce un tag XHTML, per esempio img:

<xsl:template match="immagine">
    <xsl:element name="img">
        <xsl:attribute name="src">
            <xsl:value-of select="@file"/>
        </xsl:attribute>
    </xsl:element>
</xsl:template>

analogamente per il tag a con attributo href