Re: parametre perdu

julien TOUCHE <[email protected]>
Newsgroups gmane.text.xml.french.tech
Message-ID <[email protected]>
Herve AGNOUX wrote on 25/04/2006 00:21:
> Et si vous écriviez "$cur_image/path" ?...
ah, je me disais bien que ca devait être bête ...
merci à tous les 2.

par contre, dans la suite, j'obtiens:

**3 treating1 </path/to/1.jpg>.
**3 Getting </path/to/1.jpg>. (position 0)
**3 treating2 </path/to/2.jpg>.
**3 Getting </path/to/2.jpg>. (position 1)
**3 treating3 </path/to/3.jpg>.
**3 Getting </path/to/3.jpg>. (position 2)
**3 treating4 </path/to/4.jpg>.
**3 treating1 </path/to/4.jpg>.
**3 Getting </path/to/4.jpg>. (position 0)
**3 treating2 <>.				<= les problèmes commencent
**1 Getting <>.
**3 treating3 <>.
**1 Getting <>.


avec le code recursif (puisque les modifications de variables marchent
pas) suivant:

le début est le code précédent avec un '$' en plus, la phase 4 étant:

        <xsl:message>**3 treating4 &lt;<xsl:value-of
select="$image[4]/path"/>&gt;.</xsl:message>
        <xsl:choose>
          <xsl:when test="$image[4]/note &lt; 3">
            <xsl:call-template name="p3parPage">
              <xsl:with-param name="image" select="$image[4]"/>
              <xsl:with-param name="positionPage" select="0"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:call-template name="p1parPage">
              <xsl:with-param name="image" select="$image[4]"/>
              <xsl:with-param name="positionPage" select="0"/>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>

normalement on rentre dans p3parPage (auquel appartient le bout de code
ci-dessus)

  <xsl:template name="p3parPage">
    <xsl:param name="image" select="error"/>
    <xsl:param name="positionPage" select="error"/>

        <xsl:copy-of select="$header" />

        <xsl:message>**3 treating1 &lt;<xsl:value-of
select="$image/path"/>&gt;.</xsl:message>
        <xsl:call-template name="Affiche1photoSur3">
          <xsl:with-param name="cur_image" select="$image"/>
          <xsl:with-param name="positionPage" select="0"/>
        </xsl:call-template>

        <xsl:message>**3 treating2 &lt;<xsl:value-of
select="$image[2]/path"/>&gt;.</xsl:message>
        <xsl:choose>
          <xsl:when test="$image[2]/note &lt; 3">
            <xsl:call-template name="Affiche1photoSur3">
              <xsl:with-param name="cur_image" select="$image[2]"/>
              <xsl:with-param name="positionPage" select="1"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:copy-of select="$footer" />
            <xsl:call-template name="p1parPage">
              <xsl:with-param name="image" select="$image[2]"/>
              <xsl:with-param name="positionPage" select="0"/>
            </xsl:call-template>
          </xsl:otherwise>
        </xsl:choose>

[...]


normalement sur le premier appel, le passage des variables est bon, mais
sur le
second passage, on ne recupere que la premiere ...

idées ?


merci
@+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.