Hi,
is it possible to show the following structure (made with XML:umper in Perl) in HTML table with XSL, so that item under arrayref would be its own row in html table:
<!DOCTYPE xml>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<perldata>
<hashref>
<item key="res">
<arrayref memory_address="0x1d85438">
<item key="0">1</item>
<item key="1">2</item>
<item key="2">3</item>
</arrayref>
</item>
<item key="res2">
<arrayref memory_address="0x1d85439">
<item key="0">1</item>
<item key="1">2</item>
<item key="2">3</item>
</arrayref>
</item>
</hashref>
</perldata>
I tried this, but it doesn't work correctly (how to apply template4 for item, when arrayref template is run?
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl=" <xslutput method="html" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="perldata">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="hashref">
<table border="1">
<xsl:apply-templates />
</table>
</xsl:template>
<xsl:template match="arrayref">
<tr>
<td>
<xsl:apply-templates />
</td>
</tr>
</xsl:template>
<xsl:template match="item">
<td>
<xsl:copy-of select="." />
</td>
</xsl:template>
</xsl:stylesheet>
Br, Comma
is it possible to show the following structure (made with XML:umper in Perl) in HTML table with XSL, so that item under arrayref would be its own row in html table:
<!DOCTYPE xml>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>
<perldata>
<hashref>
<item key="res">
<arrayref memory_address="0x1d85438">
<item key="0">1</item>
<item key="1">2</item>
<item key="2">3</item>
</arrayref>
</item>
<item key="res2">
<arrayref memory_address="0x1d85439">
<item key="0">1</item>
<item key="1">2</item>
<item key="2">3</item>
</arrayref>
</item>
</hashref>
</perldata>
I tried this, but it doesn't work correctly (how to apply template4 for item, when arrayref template is run?
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl=" <xslutput method="html" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="perldata">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="hashref">
<table border="1">
<xsl:apply-templates />
</table>
</xsl:template>
<xsl:template match="arrayref">
<tr>
<td>
<xsl:apply-templates />
</td>
</tr>
</xsl:template>
<xsl:template match="item">
<td>
<xsl:copy-of select="." />
</td>
</xsl:template>
</xsl:stylesheet>
Br, Comma