Conversion from XML Data to XForms using XSLT
|July 16, 2014||Posted by forumadmin under TechQns||
I want to visualise a bulk of data in an XML format, I found that xForms is a good choice for this purpose. while I’m googling it I found that xslt is a tool to transform between xml formats ( xforms among others).
My goal is just to view my xml data in xforms.
I wrote the following code to do transformation. but I’m facing a lot of troubles.
<head> <xforms:model id="my model"> <xforms:instance xmlns="" id="i" src="file.xml"> </xforms:instance> </xforms:model> </head> <body> <h2>LIST</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>"year"</th> <th>"Count_Student"</th> <th>"a50_60"</th> </tr> <xsl:for-each select="Statistics"> <tr> <td> <xsl:value-of select="year"/> </td> <td> <xsl:value-of select="Count_Student"/> </td> <td> <xsl:value-of select="a50_60"/> </td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:styleheet>
where the file “file.xml” contains the following
<Statistics> <year>2005_2006</year> <Count_Student>2</Count_Student> <a50_60>1</a50_60> </Statistics>
When executing that code, nothing is depicted.
Thanks in advance.
|Asked By – user1412823||Read Answers|