Archive for the 'SW Develop' Category

Verifica presenza <p>

Wednesday, December 19th, 2007

Per verificare la presenza di <p> come primi elementi in un nodeset contenutore da un XML basta applicare questa

<xsl:if test="description/child::*[1][self::p]"> .... </xsl:if>

dove description e’ il campo xml che contiene il pezzo html.

XSLT Song

Wednesday, October 10th, 2007

Trovata da una mail di un sviluppatore nell’archivio di una mail listing dedicata al XSLT

<?song version="1.0" name="XSLT"?>
<!-- using YMCA music -->
 
Young man, there's no need to feel blue
I said, young man, here's a language for you
If your data doesn't look like it ought
There's no need to feel so distraught
 
Young man, if you're going through hell
Trying to transform all of your XML
I said young man, are you listenin' to me?
You can stick that damn ASP...
 
<xsl:template name="chorus">
It's fun to program in XSLT!
It's fun to program in XSLT!
Every line in your code
Is an XML node
And the program is one big tree
 
It's fun to program in XSLT!
It's fun to program in XSLT!
It works functionally
And it's side-effect free
And the variables don't vary
</xsl:template>
 
It's a language like no other you've seen
It's got constructs that will make you turn green
It's recursive as a thing that recurs
And it ain't got no procedures
 
Young man - if you don't know .NET
And you haven't read your Java books yet
There is still time to learn XSLT
It's almost as easy as C...
 
<xsl:call-template name="chorus"/>
 
XSLT!
XSLT!
Young man, young man, there's no need for distress!
Young man, young man, put down that CSS!
 
 
XSLT!
XSLT!
XSLT!... etc.
 
<graphic id="dancers" type="ascii-graphics">
	  X        ,-     |
	 /0\       \0     |O___   ___O___
	 -|-       /\      |         |
	  |       |-'      |         |
	 / \     / \      / \       / \
</graphic>

Replace di stringhe

Wednesday, August 8th, 2007

Ecco un template utile per il replace di una stringa con un altra stringa, in XSLT.

Molto utile senza dover scomodare con una soluzione java embedded nel template XSL.

(more…)

Ordinamento e raggruppamento con XSLT

Wednesday, July 25th, 2007

Riporto un semplice esempio per poter fare il sorting e raggruppamento con i template XSL.

(more…)

Qualche barbatrucco con XSLT

Wednesday, July 11th, 2007

Molti di voi sviluppando template su XSL si è scontrato più volte con le limitazioni di XSLT 1.0 specialmente sui loop. Cercando qua e la ho trovato dei suggerimenti interessanti per superare questi limiti.

(more…)

Opera passa il test Acid 2

Monday, March 13th, 2006

Opera, nella versione 9 è diventato il secondo browser dopo Safari a superare il test Acid 2 che verifica la correttezza del comportamento del parsing CSS.

Seguendo questo link c’è un riepiloco cronologico della compatibilità del test lungo le varie versioni dalla 1 all’ ultima.

Spero che Mozilla sistemi l’engine Gecko con il prossimo rilascio di Firefox 2.0.