Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,

Sorry for a confusing question.

Scenario:
A general HTML table, with pre defined contents in the cells, but a JavaScript variable was calculated(can also use a PHP variable, i just need a variable which i can use later for populating rest of the table) through XSLT while populating cell1 and i have to use the same JavaScript variable to populate rest of the cells.

<html>
     <head>
     </head>
     <body>
          <table>
              <tbody>
              <tr>
              <td>
                   <xsl:for-each select="document('Random.xml')">
                   <xsl:for-each select="Node1">
                   <xsl:for-each select="@Name">
                         <span style="font-size:10pt; ">
                              <xsl:value-of select="." />//a value "Andy" is read from xml file and also populated into the cell here
                         </span>
                         <script language="javascript" type="text/javascript">
                           Name = "<xsl:value-of select="." />";//Storing Andy in JS Var (or) i can use a php variable to store "Andy" in it, i dont knw how to do it in php.
                        </script>
                        <xsl:variable name="XslVarName">
                              <xsl:value-of select="." />//Storing Andy in an XSLT variable. But this is not working
                        </xsl:variable>
                    </xsl:for-each>
                    </xsl:for-each>
              </td>
              <td>
                  //Now how do i put the value of that JS or php variable or XSLT variable in this cell so that i dont have to read the xml file in all the td's. The text in this cell should be Hello Andy?
              </td>
              </tbody>
         </table>
      </body>
</html>


1.)how do i put the value of that JS or php variable or XSLT variable in this cell so that i dont have to read the xml file in all the td's. The text in this cell should be Hello Andy? //i want to put it in a hard coded way instead of actually calling a onload function and populate rest of the table using the JavaScript variable.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900