orionfragdaddy
MIS
I am trying to learn xml and xsl.
I have this simple xml:
and this xsl:
I want to loop through EACH of the appnames and show their appname,filename, version, and required values in rows.
I can't see what I am doing incorrectly.
I have searched the tutorials - as a matter of fact, this is based on one I found online. Thank you.
I have this simple xml:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="transform.xsl"?>
<system>
<systemname>XP Common</systemname>
<baseline>1.3</baseline>
<systemip>192.168.1.100</systemip>
<applications>
<appname>00012314-Apache</appname>
<filename>apache.exe</filename>
<version>2.0</version>
<required>yes</required>
<appname>V00012345-Microsoft Office PowerPoint</appname>
<filename>POWERPNT.exe</filename>
<version>12.0.6500.5000</version>
<required>yes</required>
<appname>V000123456-Adobe Acrobat Reader 9</appname>
<filename>AcroRd32.exe</filename>
<version>9.3.2.163</version>
<required>yes</required>
</applications>
</system>
and this xsl:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:template match="/">
<html>
<body>
<h2>XML Text</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Custom App Name</th>
<th>Filename</th>
<th>Version</th>
<th>Required</th>
</tr>
<tr>
<xsl:for-each select="system/applications">
<td><xsl:value-of select="appname"/></td>
<td><xsl:value-of select="filename"/></td>
<td><xsl:value-of select="version"/></td>
<td><xsl:value-of select="required"/></td>
</xsl:for-each>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I can't see what I am doing incorrectly.
I have searched the tutorials - as a matter of fact, this is based on one I found online. Thank you.