Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Perl: Общие вопросы > ошибка трансформации


Автор: comtat 23.4.2008, 14:47
Есть скрипт:
Код

#!C:/Perl/bin/perl.exe -w

use diagnostics;
use strict;

use XML::XSLT;

my $path = "D:/winnet/task/";
my $xslfile = $path."steps/11.xsl";
my $xmlfile = $path."data.xml";

if (!-e $xslfile) {
    print "XSL file $xslfile does not exist!\n";
}
if (!-e $xmlfile) {
    print "XML file $xmlfile does not exist~\n";
}

my $parser = XML::XSLT->new ($xslfile, "FILE",
                         use_deprecated => 1);

$parser->transform_document ($xmlfile, "FILE");
#$parser->print_result;

#$parser->dispose ();

при запуске выдает вот такой еррор:
Код

Unrecognized escape \d passed through at c:/Perl/site/lib/XML/DOM.pm line 136.
Argument syntax of call to XML::XSLT::new deprecated.  See the documentation for
 XML::XSLT::new at D:\winnet\task\steps\step3.pl line 19
Use of uninitialized value in subroutine entry at
        c:/Perl/site/lib/XML/Parser/Expat.pm line 444 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl tells you what operation
    you used the undefined value in.  Note, however, that perl optimizes your
    program and the operation displayed in the warning may not necessarily
    appear literally in your program.  For example, "that $foo" is
    usually optimized into "that " . $foo, and the warning will refer to
    the concatenation (.) operator, even though there is no . in your
    program.

Can't call method "getNextSibling" on an undefined value at
        c:/Perl/site/lib/XML/XSLT.pm line 484 (#2)
    (F) You used the syntax of a method call, but the slot filled by the
    object reference or package name contains an undefined value.  Something
    like this will reproduce the error:

        $BADREF = undef;
        process $BADREF 1,2,3;
        $BADREF->process(1,2,3);

Uncaught exception from user code:
        Can't call method "getNextSibling" on an undefined value at c:/Perl/site
/lib/XML/XSLT.pm line 484.
        XML::XSLT::__get_first_element('XML::XSLT=HASH(0x183f0a8)') called at c:
/Perl/site/lib/XML/XSLT.pm line 413
        XML::XSLT::__preprocess_stylesheet('XML::XSLT=HASH(0x183f0a8)') called a
t c:/Perl/site/lib/XML/XSLT.pm line 312
        XML::XSLT::open_xsl('XML::XSLT=HASH(0x183f0a8)', 'use_deprecated', 1, 'S
ource', 'D:/winnet/task/steps/11.xsl') called at c:/Perl/site/lib/XML/XSLT.pm li
ne 102
        XML::XSLT::new('XML::XSLT', 'D:/winnet/task/steps/11.xsl', 'FILE', 'use_
deprecated', 1) called at D:\winnet\task\steps\step3.pl line 19


Первоначально думал на xls, но пробывал разные одно и тоже
Подскажите в чем может быть проблема

Автор: shamber 23.4.2008, 14:51
goggle 
Код

Update: 4 December 2000 

Playing with the new XML version (not yet quite released) and Perl 5.6, I came across one installation error. (Hey, our best yet!). This time, it's not our fault -- it's an error in XML::DOM, on line 136, namely 
Unrecognized escape \d passed through at <path to Perl lib>/XML/DOM.pm line 136.
. The fix for this is easy. Just edit the XML::DOM file manually, and change line 136 to something like the following: $ReCharRef = "(?:\�(?:\[0-9]+|x[0-9a-fA-F]+);)"; There's a nice Deja thread on it, and this is the nicest solution I've seen.



Попробуйте почитать http://www.perlmonks.org/index.pl?node_id=60747

Автор: Bulat 23.4.2008, 19:19
comtat, в чем конкретно состоит задача?? В данный момент юзаю 

use XML::LibXSLT;
use XML::LibXML;

проблем с ними вроде не было smile

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)