xsl-list
[Top] [All Lists]

XSL node reference problem

2004-05-21 03:07:07
Hi everybody !
First, I will introduce myself, my name is Paul, i'm a french student
(Master of computer sciences) and i work with xslt for one month so be cool
with my bad English and my low level in XSLT, thanks !

so i have some trouble for 4 days with this problematic :
I have an XML file like that :
<FILE>
      <SCALAR>
            <LABEL>toto</LABEL>
            <VALUE>123</LABEL>
      </SCALAR>
      <SCALAR>
            <LABEL>tata</LABEL>
            <VALUE>456</LABEL>
      </SCALAR>
      <STRUCT>
            ...
      </STRUCT>
      <SCALAR>
            <LABEL>titi</LABEL>
            <VALUE>789</LABEL>
      </SCALAR>
</FILE>

and i have done a XSL Template that permitt me to obtain the path of a
specific SCALAR :
<xsl:template name="chercheNode">
  <xsl:param name="nom"/>
  <xsl:value-of select="descendant::*[ (self::struct or self::scalar) and
label =$nom ]"/>
</xsl:template>

And I call this one with this :

<xsl:variable name="tata">
  <xsl:call-template name="chercheNode">
     <xsl:with-param name="nom">tata</xsl:with-param>
  </xsl:call-template>
</xsl:variable>

I have the node that i would have BUT i can't apply

<xsl:for-each select="$tata">
  <xsl:value-of select="./value"/>
</xsl:for-each>

because it result with a null value, the transformation don't return a
value.

I think it's a problem of copy ! perhaps i don't have a pointer on the node
but just a copy of it but i don't know how to obtain a reference ...

If you could help me, i will be very happy because i'll become mad with
this ... and all idea is good !

thanks !!!!






******************************************************************
The sender's email address has changed to 
firstname.lastname@ sgcib.com. You may want to update your 
personal address book. Please see http://www.sgcib.com for more 
information.
                               **
This message and any attachments (the "message") are confidential
and intended solely for the addressee(s). Any unauthorised use or
dissemination is prohibited. E-mails are susceptible to alteration.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall be liable for the message if altered, changed or falsified.
                         ***************
L'adresse mail  de votre correspondant a change en prenom.nom@ sgcib.com.
Il est recommande de mettre a jour votre carnet d'addresse
personnel.Pour plus d'informations, aller  sur http://www.sgcib.com
                               **
Ce message et toutes les pieces jointes (ci-apres le "message")
sont confidentiels et etablis a l'intention exclusive de ses
destinataires. Toute utilisation ou diffusion non autorisee est
interdite. Tout message electronique est susceptible d'alteration.
La SOCIETE GENERALE et ses filiales declinent toute
responsabilite au titre de ce message s'il a ete altere, modifie
ou falsifie.
******************************************************************



<Prev in Thread] Current Thread [Next in Thread>