2011年9月13日星期二

Sample of XML::Dumper, working with xslt

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/perldata/hashref">

<html>

<body>

  <table border="1">

   <tr>

    <th>Key</th>

    <th>Value</th>

   </tr>

    <xsl:for-each select="item">

    <tr>

     <td><xsl:value-of select="@key"/></td>

     <td><xsl:value-of select="."/></td>

    </tr>

</xsl:for-each>

</table>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

$ perl -MXML::Dumper -le 'print pl2xml(\%INC)' | xsltproc perlhash.xsl - | w3m -T text/html

Posted via email from purl's posterous

没有评论: