 |
 |
 |
> @text() is not a valid XPath expression
Actually it is a valid expression. It selects all text nodes on the
attribute axis. There aren't any, so it returns nothing (an empty sequence).
Michael Kay
http://www.saxonica.com/
>
> You should have an error
>
> Xmlizer
>
> 2009/4/5 Pierluigi Fabbris <pierluigi.fabbris@xxxxxxxx>
> >
> > In my code that Ive put down. Ive problem for the <xsl:if
> > test="./ricetta/@id =vino_consigliato/@ricetta">
> >
> > The result should be that the program show for every
> vino_consigliato
> > in ricetta that has the same id. Why the test dont work?
> Where is the error?
> >
> > Ricettario.xml
> > -------------------
> > <?xml version="1.0" encoding="ISO8859-1"?> <!DOCTYPE
> ricettario SYSTEM
> > "ricettario.dtd"> <?xml-stylesheet type="text/xsl"
> > href="ricettario.xsl"?> <ricettario> <ricetta titolo="Zuppa
> di cipolle
> > con crostone gratinato all'emmental"
> > id="r1">
> > <ingredienti persone="4">
> > <ingrediente quantita="8"> cipolle grandi</ingrediente>
> <ingrediente
> > quantita="4 cucchiai"> farina </ingrediente> <ingrediente
> quantita="1
> > foglia"> alloro </ingrediente> <ingrediente quantita="un po'"> olio
> > d'oliva </ingrediente> <ingrediente quantita="1 litro"> brodo
> > </ingrediente> <ingrediente quantita="4 fette"> pancarrh
> > </ingrediente> <ingrediente quantita="100 grammi"> emmental
> > </ingrediente> <ingrediente quantita="q.b."> sale e pepe
> > </ingrediente> </ingredienti> <preparazione> Mettete a soffriggere
> > nell'olio d'oliva l'alloro e aggiungere la cipolla precedemente
> > affetata fine e farla cucinare a fuoco lento fino a che non
> > imbiondisce.
> > Aggiungere poi la farina e far rosolare fino a quando non prende un
> > bel colore dorato. Aggiiungere il brodo e lasciar cucinare
> ancora per
> > venti minuti circa, in modo che la zuppa so presenti ben cremosa.
> > A parte mettere le fette di pancarrh in una teglia metterci sopra
> > dell'emmental (a piacere una spolverata di paprika) e
> infornare per 8
> > minuti a forno caldo.
> > Servire la zuppa con il crostone fondente sopra.
> > </preparazione>
> > </ricetta>
> > <ricetta titolo="Canederli di zucca con radicchio trevisano
> e pancetta
> > croccante" id="r2"> <ingredienti persone="4"> <ingrediente
> > quantita="8"> panini</ingrediente> <ingrediente
> quantita="100 grammi">
> > zucca </ingrediente> <ingrediente quantita="100 grammi"> formaggio
> > asiago </ingrediente> <ingrediente quantita="2"> uova
> </ingrediente>
> > <ingrediente quantita="1 bicchiere"> latte </ingrediente>
> <ingrediente
> > quantita="un po'"> prezzemolo tritato </ingrediente> <ingrediente
> > quantita="100 grammi"> pancetta a pezzi </ingrediente> <ingrediente
> > quantita="200 grammi"> burro </ingrediente> <ingrediente
> > quantita="q.b."> sale e pepe </ingrediente> </ingredienti>
> > <preparazione> Tagliare la zuccca e cubetti, farla padellare con un
> > po' di burro e lasciarla cucinare per 10 minutii. In una bacinella
> > abbastanza capiente mettere il pane tagliato a pezzetti, le
> uova, il
> > prezzemolo, la zucca, il latte, sale e pepe.
> > Amalgamare il tutto formando un impasto morbido e omogeneo
> (in base al
> > pane usato pur cambiare la consistenza dell'impasto; se si presenta
> > troppo asciutto aggiungere un po' di latte; se si presenta troppo
> > bagnato aggiungere un po' di pane gratuggiato).
> > Formare poi dei piccoli canederli e dargli una forma un po'
> ovalizzata
> > e cucinarli per 15 minuti in acqua salata. Disporli in
> piatti a forma
> > di stella e metterci sopra il radicchio tagliato a pezzetti. In una
> > padella far abbrustolire la pancetta nel rimanente burro e
> caspargere
> > poi sopra i canederli; spolverare di parmiggiano e servire.
> > </preparazione>
> > </ricetta>
> > <vino_consigliato ricetta="r1">
> > pinot grigio
> > </vino_consigliato>
> > <vino_consigliato ricetta="r2">
> > muller thurgau
> > </vino_consigliato>
> > </ricettario>
> >
> > Ricettario.xsl
> > --------------------
> >
> > <?xml version="1.0" encoding="ISO8859-1"?> <xsl:stylesheet
> > version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > <xsl:template match="ricettario">
> > <html>
> > <head>
> > <title> Ricette </title>
> > </head>
> > <body>
> > <xsl:apply-templates/>
> > </body>
> > </html>
> > </xsl:template>
> > <xsl:template match="ricetta">
> > <center>
> > <h1>
> > <xsl:value-of select="./@titolo"/>
> > </h1>
> > </center>
> > <br/>
> > <br/>
> > <br/>
> > <br/>
> > <xsl:apply-templates/>
> > <br/>
> > <xsl:if test="./ricetta/@id
> > =vino_consigliato/@ricetta">
> > <xsl:value-of
> > select="/ricettario/vino_consigliato/@text()"/>
> > </xsl:if>
> > </xsl:template>
> > <xsl:template match="ingredienti">
> > <table align="center">
> > <tr>
> > <td >
> > ingredienti per <xsl:value-of select="./@persone"/> persone </td>
> > </tr> <tr> <td> Quantit` </td> <td> Ingrediente </td> </tr>
> > <xsl:for-each select="ingrediente"> <tr> <td> <xsl:value-of
> > select="./@quantita"/> </td> <td> <xsl:value-of select="./text()"/>
> > </td> </tr> </xsl:for-each> </table> <br/> <br/> <br/> <br/>
> > </xsl:template> <xsl:template match="preparazione"> <p
> > align="justify">
> > <xsl:value-of select="./text()"/> </p>
> </xsl:template>
> > </xsl:stylesheet>
> >
> >
> > Sincerally yours.
> >
> > Fabbris Pierluigi
> > Via alle Grazie, 10/a
> > 38050 Canal San Bovo
> > Tel. 3467168672
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |