Hi All,I am facing one problem on xslt.I have a perl file where i am giving path of one xml file and xsl file to translate it.When all 3 files xml, xsl and perl file are in same folder then it is working fine.But when i am putting xml file somewhere else location and giving its path on perl program then it is giving me error...[html]no element found at line 1, column 0, byte -1 at C:/Perl/site/lib/XML/Parser.pm line 185c:/test3.xml at C:/Perl/lib/XML/XSLT.pm line 1507.[/html]I hv putted perl supporting path. What cud be the reason of its not working.Pls suggest me what cud be the issue?Nidhi...
Hi Ambuj,here is the perl code that works....[html]# !/usr/bin/perl# import required modulesuse XML::XSLT;use XML::XPath;use Tie::File;use strict;my $XMLtoRead = 'test3.xml';my $OutPutFile = 'c:\temp.xml';# define local variablesmy $xslfile = "test2.xsl";# create an instance of XSL::XSLT processormy $xslt = XML::XSLT->new ($xslfile);open(PROPFILE, "> $OutPutFile") || die("Cannot open OutPut file: $OutPutFile, Error $!\n");# transform XML file and print outputprint PROPFILE $xslt->serve($XMLtoRead);close(PROPFILE);# free up some memory$xslt->dispose();[/html]here is the perl code that dosent works....[html]# !/usr/bin/perl# import required modulesuse XML::XSLT;use XML::XPath;use Tie::File;use strict;my $XMLtoRead = 'c:/test3.xml';my $OutPutFile = 'c:/temp.xml';# define local variablesmy $xslfile = "test2.xsl";# create an instance of XSL::XSLT processormy $xslt = XML::XSLT->new ($xslfile);open(PROPFILE, "> $OutPutFile") || die("Cannot open OutPut file: $OutPutFile, Error $!\n");# transform XML file and print outputprint PROPFILE $xslt->serve($XMLtoRead);close(PROPFILE);# free up some memory$xslt->dispose();[/html]
my $XMLtoRead = 'c:/test3.xml';my $OutPutFile = 'c:/temp.xml';
my $XMLtoRead = 'c:\test3.xml';my $OutPutFile = 'c:\temp.xml';
Hi Ambuj,I have tried both.But both are not working.Its working in perl file directory or sub directory.Nidhi...