in reply to Re^2: Using XML::XSLT to convert XML to CSV
in thread Using XML::XSLT to convert XML to CSV

I'm not sure what the problem could be (and I don't have a windows perl available at the moment) but this works for me on linux:
use strict; use XML::XSLT; my $xmlFilename = '/home/joost/input.xml'; my $xslFilename = '/home/joost/input.xsl'; (my $outFilename = $xmlFilename) =~ s/\.xml$/\.csv/i; my $xslt = XML::XSLT->new($xslFilename, warnings => 1); $xslt->transform($xmlFilename); print $xslt->toString;
Can't help you much further than that, though.

update: did you update the XML modules, or where they already at the latest version?

You can check by doing

perl -MXML::XSLT -e'print "$XML::XSLT::VERSION\n"'
and similar for XML::Parser

Replies are listed 'Best First'.
Re^4: Using XML::XSLT to convert XML to CSV
by Photius (Sexton) on Aug 27, 2007 at 19:50 UTC
    When I paste the above in my Windows XP command line to check the version, I get:
    Can't find string terminator "'" anywhere before EOF at -e line 1.
    However, I put this in a script file:
    use XML::XSLT; print "$XML::XSLT::VERSION\n";
    and then it prints:
    0.48
      also
      XML::Parser version is 2.34
        Ok, that's also the same as mine.

        Under normal windows semantics

        "C:/path/to/file.xml"
        should be acceptable, provided you've actually got permissions to read that file (which probably includes read access to the directories above it)

        You can try passing an XML::DOM object instead of a file (XML::XSLT supports both):

        # stuff here.. my $parser = new XML::DOM::Parser; my $doc = $parser->parsefile ("c:/path/to/file.xml"); $xslt->transform($doc); # proceed