I am struggling to get XML::XSLT to work under mod_perl 2.0. All it takes is using the basic MyApache::Rocks module from the docs, and adding the following line to cause the error, but I have tried it in other various mod_perl 2.0 programs as well, all with the same results:
Error while parsing: \nsyntax error at line 1, column 0, byte 0 at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/XML/Parser.pm line 187\n\ntest.xsl at /usr/lib/perl5/site_perl/5.8.0/XML/XSLT.pm line 1506.\n
The code my Perl module is referencing contains one simple call (along with use XML::XSLT;):
my $xslt = XML::XSLT->new ('test.xsl', warnings => 1);
Doing a trace, that is what is generating the error, and it seems to fail in XML::Parser::Expat's ParseString() call. "test.xsl" contains the basic test xsl script from w3schools.com:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th align="left">Title</th> <th align="left">Artist</th> </tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template>
</xsl:stylesheet>
When I run this under mod_perl I get the syntax error. When I run it as a regular perl script it runs fine without any errors. I have searched every resource I can find and can't seem to find anyone else with this problem. Does anyone have any suggestions on where I could go from here? It seems really weird that mod_perl would even affect something as simple as parsing an xml file.
-Jesse
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html