Go Back   Forum > Tecno-Cool > Hardware & Software

LOGIN

Register FAQ Live Now! Rules Live TV Arcade Search Today's Posts Mark Forums Read






× Notice: This forum is read-only.The content of the community may not be verified or updated. More info
Reply
 
Thread Tools Search this Thread Display Modes Translate
  #1  
Old 11-04-2007, 01:18 PM
ABNormal ABNormal is offline
Administrator
 
ABNormal's Avatar
 

Join Date: May 2005
Posts: 3,978
ABNormal is on a distinguished road
Send a message via ICQ to ABNormal Send a message via MSN to ABNormal Send a message via Yahoo to ABNormal
Default

PROBLEMI con un XSL...


questo xsl mi gestisce una lista:
HTML Code:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body style="color: rgb(204, 255, 255); background-color: rgb(255, 255, 255); background-image: url(background.jpg);" alink="#ffffcc" link="#ccffff" vlink="#66ffff"> <xsl:apply-templates> </xsl:apply-templates> </body> </html> </xsl:template> <xsl:template match="Contents"> <xsl:for-each select = "Movie"> <xsl:sort select="OriginalTitle" data-type="text" /> <xsl:choose> <xsl:when test="Category = MOVIES"> <h1><xsl:value-of select="OriginalTitle" /></h1> <h1><xsl:value-of select="Category" /></h1> </xsl:when> <xsl:otherwise> <h6><xsl:value-of select="Category" /></h6> <h6><xsl:value-of select="OriginalTitle" /></h6> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:template> </xsl:stylesheet>


stranamente sebbene in Category una possibile definizione è MOVIES, lo script xsl mi mostra tutto in formato <.h6.> anche per i dati che hanno categoria MOVIES


qualcuno (Ogher immagino ) sa gentilmente capirne il perchè?

ABN
__________________
«Fino a quando il colore della pelle sarà più importante del colore degli occhi ci sarà sempre la guerra.» Bob Marley


Reply With Quote
  #2  
Old 11-04-2007, 01:36 PM
Ogher Ogher is offline
Amministratore offroad
 
Ogher's Avatar
 

Join Date: Jul 2005
Location: Foam pit
Posts: 1,872
Ogher is on a distinguished road
Send a message via MSN to Ogher
Default

il problema è qui:
HTML Code:
<xsl:when test="Category = MOVIES">

il costrutto
when espressioneDaValutare
.......
otherwhise
........

funziona come un if else e in questo caso ti mostra i movies in h6 semplicemente perchè fallisce (restituisce false) l'espressione Category = MOVIES e quindi usa il contenuto di otherwise
basta sistemare l'espressione e dovrebbe funzionare, ti scrivo una possibile soluzione dato che non conosco bene la sintassi:
HTML Code:
<xsl:when test="Category='MOVIES'">
__________________
"Ad Ancelotti glielo dico sempre: 'Immagina se avessi i piedi buoni, non sapremmo dove mettere le coppe...'." G.Gattuso
"Chi vince a Siena ritorna a Siena, chi vince ad Atene va a Tokyo.." C.Pellegatti
"Meglio 1-0 per noi che 1-0 per loro.." C.Pellegatti
Io sono contro l'uso di animazioni al posto del testo su MSN
Non mandatemi messaggi privati con richieste d'aiuto su partite/software, alle partite non rispondo e per i software ci sono i sottoforum dedicati.


Reply With Quote
  #3  
Old 11-04-2007, 02:51 PM
ABNormal ABNormal is offline
Administrator
 
ABNormal's Avatar
 

Join Date: May 2005
Posts: 3,978
ABNormal is on a distinguished road
Send a message via ICQ to ABNormal Send a message via MSN to ABNormal Send a message via Yahoo to ABNormal
Default

Quote:
Originally Posted by Ogher
il problema è qui:
HTML Code:
<xsl:when test="Category = MOVIES">

il costrutto
when espressioneDaValutare
.......
otherwhise
........

funziona come un if else e in questo caso ti mostra i movies in h6 semplicemente perchè fallisce (restituisce false) l'espressione Category = MOVIES e quindi usa il contenuto di otherwise
basta sistemare l'espressione e dovrebbe funzionare, ti scrivo una possibile soluzione dato che non conosco bene la sintassi:
HTML Code:
<xsl:when test="Category='MOVIES'">

avevo provato l'opzione contraria (@category=MOVIES) ma non aveva funzionato.
appena torno a casa ci riproo
grazie mille
ABN
__________________
«Fino a quando il colore della pelle sarà più importante del colore degli occhi ci sarà sempre la guerra.» Bob Marley


Reply With Quote
Reply







Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +2. The time now is 02:00 AM.


Powered by: vBulletin Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.