Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: XML::XSLT problem

by Trainer (Initiate)
on Mar 18, 2015 at 18:13 UTC ( [id://1120480]=note: print w/replies, xml ) Need Help??


in reply to Re: XML::XSLT problem
in thread XML::XSLT problem

I am trying to use WordXML file as my xml file and wordml2latex.xsl as Stylesheet but I get an 'createDocumentFragment' error.I tried the 2 solutions given in this forum but still unable to fix it.Would any one please help me. Thanks in advance.(my code is in below)
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; # instead of use XML::XSLT; ... #unshift @INC, "C:\\Perl64"; #require XML::XSLT; use XML::XSLT; #use XML::DOM; #use XML::Parser; #use XML::Simple; #use LWP::Simple; #WORDXML to XSLT(wordml2latex) using XML::XSLT my $xslfile_path = "C:\\temp\\wordml2latex.xsl"; my $xmlfile_path = "C:\\temp\\Sample document.xml"; open my $xmlfile, '<', $xmlfile_path or die "Cannot open '$xmlfile_pat +h': $!\n"; my $xmlfile_contents; { local $/ = undef; $xmlfile_contents = <$xmlfile>; close $xmlfile; } #print $xmlfile_contents; # exit 1; open my $xslfile, '<', $xslfile_path or die "Cannot open '$xslfile_pat +h': $!\n"; my $xslfile_contents; { local $/ = undef; $xslfile_contents = <$xslfile>; close $xslfile; } #print $xslfile_contents; my $xslt = XML::XSLT->new (Source => $xslfile_contents, warnings => 1) +; $xslt->transform ($xmlfile_contents); print $xslt->toString; $xslt->dispose();

Replies are listed 'Best First'.
Re^3: XML::XSLT problem
by Anonymous Monk on Mar 18, 2015 at 23:08 UTC
    Why are you reading/slurping the file yourself instead of letting XML::XSLT read the file?
      Actually it is not reading by itself.It gives me an error. I tried the same code with a standard XML file and a standard XSL file and it worked. I am not sure if it is causing because I am using WordXML or it is causing because I am using wordxml2latex stylesheet(I got this template from internet) ... This is very important task for me and it doesn't work

        You can help us help you better by posting the exact error message you get, and the relevant XML and the relevant XSLT parts that cause the error.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1120480]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found