Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    245

    Google Appliance - MIME Types nel Front-end XSL

    Ciao a tutti,
    è la prima volta che lavoro con Google Appliance, quindi scusate se la domanda magari è un pò banale: sto customizzando uno stylesheet e voglio inserire un'icona relativa alla tipologia di risultato a fianco del titolo dello stesso, invece del default [TEXT] [WORD] ecc..

    C'era già una lista di MIME types definiti a cui appunto ho sostituito il default con un'immagine, ecco la lista:

    codice:
    <xsl:when test="@MIME='text/html' or @MIME='' or not(@MIME)">[img]...[/img]</xsl:when>
    <xsl:when test="@MIME='text/plain'">[img]...[/img]</xsl:when>
    <xsl:when test="@MIME='application/rtf'">[img]...[/img]</xsl:when>       <xsl:when test="@MIME='application/pdf'">[img]...[/img]</xsl:when>       ...
    A questa lista volevo aggiungere il MIME per le jpeg, ed ho aggiunto questa riga

    <xsl:when test="@MIME='image/jpeg'">[img]...[/img]</xls>

    ma non funziona.

    Qualche idea?!
    Thanks
    Lau

  2. #2
    Utente di HTML.it
    Registrato dal
    Feb 2003
    Messaggi
    245
    Vi posto anche l'operatore condizionale:

    codice:
     <xsl:choose>
          <xsl:when test="@MIME='text/html' or @MIME='' or not(@MIME)">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='text/plain'">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='application/rtf'">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='application/pdf'">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='application/postscript'">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='application/vnd.ms-powerpoint'">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='application/vnd.ms-excel'">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='application/msword'">[img]...[/img]</xsl:when>
          <xsl:when test="@MIME='image/jpeg'">[img]...[/img]</xsl:when>
          <xsl:otherwise>
            <xsl:variable name="extension">		
              <xsl:call-template name="last_substring_after">
                <xsl:with-param name="string" select="substring-after(	
                                                      $temp_url,
                                                      '/')"/>
                <xsl:with-param name="separator" select="'.'"/>
                <xsl:with-param name="fallback" select="'UNKNOWN'"/>
              </xsl:call-template>
            </xsl:variable>
            [<xsl:value-of select="translate($extension,$lower,$upper)"/>]
          </xsl:otherwise>
        </xsl:choose>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.