Febbraio 2008


Per impostare il valore (testuale) di una varibile xsl si può usare il seguente costrutto:
<xsl:variable name="current_stage">
<xsl:choose>
<xsl:when test="$competition_id = '2' and count(/SportsContent/Stage[@stId = '4']/Standing/Team) > 0">4</xsl:when>
<xsl:when test="$competition_id = '2' and count(/SportsContent/Stage[@stId = '4']/Standing/Team) = 0">5</xsl:when>
</xsl:choose>
</xsl:variable>

o, più in generale
<xsl:variable name="var">
 <xsl:choose>
  <xsl:when test="...expr1...">10</xsl:when>
  <xsl:when test="...expr2...">10</xsl:when>
  <xsl:otherwise>15</xsl:otherwise>
 </xsl:choose>
</xsl:variable>

Il costrutto precedente non è utilizzabile per assegnare dei fragment tree alla variabile; si deve utilizzare il seguente costrutto:
<xsl:variable name="stage" select="Stage[@stId =$current_stage and $competition_id = '2'] | Stage[contains(@type, 'regular_season') and $competition_id != '2']"/>

o, più in generale, pensando ad un if-else
select = valore-per-if[condizione] | valore-per-else[not(condizione)]

  • Apache HTTP Server
    • The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server
  • Apache Tomcat
    • Apache Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
  • Eclipse
    • Eclipse – an open development platform
  • JEdit
    • jEdit is a mature programmer’s text editor
  • Moodle
    • Moodle is a course management system (CMS)
  • TrueCrypt
    • TrueCrypt is a Free Open-Source Disk Encryption Software
  • KeePass
    • KeePass is a free, open source, light-weight and easy-to-use password manager