Search notes:

Perl module XML::XSLT

use warnings;
use strict;

use XML::XSLT;

my $xml = q{<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="hello.xsl"?>
<document>
  <title   >This is the Title  </title>

  <heading >This is the heading</heading>

  <date    >28.08.2015         </date>

  <item    >foo                </item>
  <item    >bar                </item>
  <item    >baz                </item>

</document>
};

my $xsl = q{<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:template match="/document">
    <html>

      <head>

        <title><xsl:value-of select="title"/></title>

      </head>

      <body>

        <h1><xsl:value-of select="heading"/></h1>

        <xsl:apply-templates select="date"/>


        <ul>
        <xsl:for-each select="item">
          <li><xsl:value-of select="."/></li>
        </xsl:for-each>
        </ul>

      </body>
    </html>
  </xsl:template>

  <xsl:template match="date">
    <p>
    <i>Date: </i> <xsl:value-of select="." />
    </p>
  </xsl:template>

</xsl:stylesheet>
};

my $xslt = XML::XSLT->new ($xsl, warnings => 1);

$xslt->transform ($xml);

open (my $html, '>', 'out.html') or die;
print $html $xslt->toString;
close $html;

$xslt->dispose();
Github repository PerlModules, path: /XML/XSLT/script.pl

See also

Perl modules
XML

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741108707, '3.138.124.234', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/XML/XSLT/index(107): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78