probleme xsl/javascript

probleme xsl/javascript - XML/XSL - Programmation

Marsh Posté le 19-07-2006 à 09:23:27    

Bonjour à tous,
 
j'ai un petit problème avec un fichier xsl dans lequel je veux utiliser du javascript.
Je n'arrive pas à transmettre des valeurs récupérées pas <xsl:value-of ...> comme arguments
à une fonction javascript le tout à l'intérieur d'une boucle xsl. La balise <script ..>
annule l'element courant du <xsl:for-each...> donc la récupération en relatif ne fonctionne
plus !!!  
Quelqu'un connait-il un moyen de contourner ce problème ?
Merci d'avance pour vos réponses.
 
 
détail du code xsl:
 
   <xsl:for-each select="//row">
      <script type="text/javascript">
         var site = <xsl:value-of select="./row_element[@column=1]"/>
         var rev  = <xsl:value-of select="./row_element[@column=2]"/>
         writeArrayTitle(site,rev)
      </script>
   </xsl:for-each>
 
 
détail du code js (dans le head du xsl) :
 
   <script type="text/javascript">
      function writeArrayTitle(name,rev) {
         /* divers tests */
         document.write(name + "/" + rev + "<br/> )
      }
   </script>
 
 
détail du xml :
   <row>
      <object_tag tag="4628" uid="gxHRqPncXWSHFB"/>
      <object_tag tag="4667" uid="QdNRqPncXWSHFB"/>
      <row_element column="0" component_tag="4664" property_name="Affaire">0278018</row_element>
      <row_element column="1" component_tag="4628" property_name="object_name">site01</row_element>
      <row_element column="2" component_tag="4628" property_name="item_revision_id">A</row_element>
      <row_element column="3" component_tag="4657" property_name="object_name">ligne01</row_element>
      <row_element column="4" component_tag="14710" property_name="item_revision_id">A</row_element>
      <row_element column="5" component_tag="14716" property_name="object_name">zone0101</row_element>
      <row_element column="6" component_tag="14849" property_name="item_revision_id">A</row_element>
      <row_element column="7" component_tag="14855" property_name="object_name">ilot010101</row_element>
      <row_element column="8" component_tag="14860" property_name="item_revision_id">A</row_element>
      <row_element column="9" component_tag="14866" property_name="object_name">POSTE_11100001</row_element>
      <row_element column="10" component_tag="14871" property_name="item_revision_id">A</row_element>
      <row_element column="11" component_tag="14876" property_name="item_id">PSE_000003</row_element>
      <row_element column="12" component_tag="14880" property_name="item_revision_id">A</row_element>
      <row_element column="13" component_tag="14884" property_name="object_name">p3</row_element>
      <row_element column="14" component_tag="14890" property_name="NumeroProduit">8200000129</row_element>
      <row_element column="15" component_tag="14887" property_name="item_id">VEH_000129</row_element>
      <row_element column="16" component_tag="14890" property_name="Indice">0_02_0002</row_element>
      <row_element column="17" component_tag="14888" property_name="name">TCM Released</row_element>
      <row_element column="18" component_tag="14887" property_name="item_revision_id">A</row_element>
   </row>
   .
   .
   .
   <row>
      <object_tag tag="4628" uid="gxHRqPncXWSHFB"/>
      <object_tag tag="4667" uid="QdNRqPncXWSHFB"/>
      <row_element column="0" component_tag="4664" property_name="Affaire">0278018</row_element>
      <row_element column="1" component_tag="4628" property_name="object_name">site01</row_element>
      <row_element column="2" component_tag="4628" property_name="item_revision_id">A</row_element>
      <row_element column="3" component_tag="4657" property_name="object_name">ligne01</row_element>
      <row_element column="4" component_tag="14710" property_name="item_revision_id">A</row_element>
      <row_element column="5" component_tag="14716" property_name="object_name">zone0101</row_element>
      <row_element column="6" component_tag="14849" property_name="item_revision_id">A</row_element>
      <row_element column="7" component_tag="14855" property_name="object_name">ilot010101</row_element>
      <row_element column="8" component_tag="14860" property_name="item_revision_id">A</row_element>
      <row_element column="9" component_tag="14866" property_name="object_name">POSTE_11100001</row_element>
      <row_element column="10" component_tag="14871" property_name="item_revision_id">A</row_element>
      <row_element column="11" component_tag="14876" property_name="item_id">PSE_000003</row_element>
      <row_element column="12" component_tag="14880" property_name="item_revision_id">A</row_element>
      <row_element column="13" component_tag="14885" property_name="object_name">p1</row_element>
      <row_element column="14" component_tag="14895" property_name="NumeroProduit">8200000127</row_element>
      <row_element column="15" component_tag="14893" property_name="item_id">VEH_000127</row_element>
      <row_element column="16" component_tag="14895" property_name="Indice">0_02_0002</row_element>
      <row_element column="17" component_tag="14893" property_name="release_status_list"> </row_element>
      <row_element column="18" component_tag="14893" property_name="item_revision_id">A</row_element>
   </row>

Reply

Marsh Posté le 19-07-2006 à 09:23:27   

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed