Questions

Answer for:

XML: How to convert an XML file into a table?

Message 5 of 5

View entire thread
+
0 Votes
compu-mechanic

A simple style sheet would suffice.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN" indent="yes"/>
<xsl:template match="/">
<html>
<body>
<!-- Assuming the content of each row is text and not an attribute of a tag-->
<table>
<xsl:for-each select="/trow/contents">
<tr><td><xsl:value-of select="."/></td></tr>
</xsl:for-each>
</table>
</body>
</html>

</xsl:template>

</xsl:stylesheet>

This should work if you change the path. You can also send it out as text and save it to file. It's not hard, look it up.