Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hello Monks,
is there any place where i can get XML::Xslt examples
I searched many places but, i coult get only partial examples
can any one who are using Xml::Xslt module post some of the examples.
Thanks

Replies are listed 'Best First'.
Re: Xml::Xslt Examples
by runrig (Abbot) on Jan 08, 2008 at 01:06 UTC
      Thanks for replay
      may i know how to use the module
      i already wrote xslt for the xml file i need
      but i dont know how to use it with perl modules
      Thanks

        hi

        If you already installed LibXML and LibXSLT modules, try this

        use strict; use XML::LibXML; use XML::LibXSLT; my $parse = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $xml = $parse->parse_file("test.xml"); my $input = $parse->parse_file ("test.xslt"); my $xslt = $xslt->parse_stylesheet($input); my $result = $xslt->transform($xml); my $html = $xslt->output_string($result); open (REPORT, "> test.html") or die "Can't open test.html $!\n"; print REPORT $html; close (REPORT);

        regards
        Balaji. M

Re: Xml::Xslt Examples
by msbalaji (Chaplain) on Jan 08, 2008 at 04:22 UTC

    Please read the CPAN documentation, this is not yet support all the xslt element and attribute like

    xsl:apply-imports Not supported yet.
    xsl:apply-templates element - attribute 'mode' - xsl:sort and xsl:with-param in content not yet supported
    Not supported yet: - attribute 'namespace'

    You can use XML::LibXSLT

    Regards
    Balaji. M