You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rob Tanner <rt...@onlinemac.com> on 2000/07/31 17:56:59 UTC

OT XML::DOM question (used in Apache::ASP)

Hi,

If one can direct me to a perl modules discuss list (I don't know of any) 
where this might be more appropriately posted, I shall be glad to oblige.

For doing XML kind of stuff, Apache::ASP uses XML-XSLT which requires 
XML::DOM.  XML::DOM is part of libxml-enno.

Build with Perl 5.6.0 I get the following errors running "make test":

[rtanner@cheshire libxml-enno-1.02]$ make test
make[1]: Entering directory 
`/home/rtanner/c_scapes/Perl/modules/XML/libxml-enno-1.02/XQLParser'
make[1]: Leaving directory 
`/home/rtanner/c_scapes/Perl/modules/XML/libxml-enno-1.02/XQLParser'
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib 
-I/usr/local/lib/perl5/5.6.0/i686-linux -I/usr/local/lib/perl5/5.6.0 -e 
'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' 
t/*.t
t/build_dom.........NOK 2FAILED test 2 

        Failed 1/2 tests, 50.00% okay
t/chk_batch.........ok 56/56FAILED tests 1, 3, 7, 15, 17, 21, 27, 29, 31, 
35, 41, 43, 49
        Failed 13/56 tests, 76.79% okay
t/dom_astress.......ok 

t/dom_attr..........Can't locate object method "equals" via package 
"XML::Parser::ContentModel" at CmpDOM.pm line 179.
t/dom_attr..........dubious 

        Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 3, 20-23
        Failed 5/23 tests, 78.26% okay
t/dom_cdata.........ok 

t/dom_example.......ok 

t/dom_extent........
error in processing external entity reference at line 4, column 1, byte 133 
at /usr/local/lib/perl5/site_perl/5.6.0/i686-linux/XML/Parser.pm line 185
t/dom_extent........dubious 

        Test returned status 255 (wstat 65280, 0xff00)
Undefined subroutine &Test::Harness::WCOREDUMP called at 
/usr/local/lib/perl5/5.6.0/Test/Harness.pm line 334.
make: *** [test_dynamic] Error 255

libxml-enno requires Perl 5.005_64 and so I tried building it that way. 
But got the same results.  I've debugged fairly simple 'make test' problems 
before, but this is either out of my league or I missing the obvious.

-- Rob

       _ _ _ _           _    _ _ _ _ _
      /\_\_\_\_\        /\_\ /\_\_\_\_\_\
     /\/_/_/_/_/       /\/_/ \/_/_/_/_/_/  QUIDQUID LATINE DICTUM SIT,
    /\/_/__\/_/ __    /\/_/    /\/_/          PROFUNDUM VIDITUR
   /\/_/_/_/_/ /\_\  /\/_/    /\/_/
  /\/_/ \/_/  /\/_/_/\/_/    /\/_/         (Whatever is said in Latin
  \/_/  \/_/  \/_/_/_/_/     \/_/              appears profound)

  Rob Tanner
  McMinnville, Oregon
  rtanner@onlinemac.com

Re: tie question

Posted by "Eric L. Brine" <eb...@home.com>.

> why is tie considered not very efficient i use it often.. what is 'a'
> much better way?

Many modules which use tie also provide an object oriented interface. It's
more efficient to use the OO interface according to benchmarks I've seen
here.

If you have two modules, one which has an OO interface and one that has a
tied interface, create a wrapper to make the tie module object oriented
instead of creating a wrapper to make the OO module into a tie.

For such wrappers to handles, check out IO::Wrap and/or IO::WrapTie (I
don't remember which). They are located in IO::Stringy on CPAN, IIRC. It's
been a while.

ELB

--
Eric L. Brine  |  Chicken: The egg's way of making more eggs.
ELB@iname.com  |  Do you always hit the nail on the thumb?
ICQ# 4629314   |  An optimist thinks thorn bushes have roses.

Re: tie question

Posted by Perrin Harkins <pe...@primenet.com>.
On Mon, 31 Jul 2000, Matt Sergeant wrote:

> On Mon, 31 Jul 2000, dreamwvr wrote:
> 
> > hi,
> >    why is tie considered not very efficient i use it often.. what is 'a'
> > much better way?
> 
> tie isn't very efficient simply because the code behind it (in the core of
> Perl) is fairly complex and slow. Theres not a lot that can be done to
> improve it according to Ilya. I don't think there _is_ a better way - tie
> is a very specific requirement, and usually its "fast enough". Remember
> that STDOUT is tied to the request object in mod_perl...

It's possible to call the object methods directly, and this will be faster
than using the tied interface.  Sometimes you can't do this because you
don't want to touch the code that uses the tied interface, but I've done
this successfully with Apache::Session and some other Tie:: modules
before.

Read the perltie manpage or open up the module you're using if you want to
see how to do it.

- Perrin


Re: tie question

Posted by Matt Sergeant <ma...@sergeant.org>.
On Mon, 31 Jul 2000, dreamwvr wrote:

> hi,
>    why is tie considered not very efficient i use it often.. what is 'a'
> much better way?

tie isn't very efficient simply because the code behind it (in the core of
Perl) is fairly complex and slow. Theres not a lot that can be done to
improve it according to Ilya. I don't think there _is_ a better way - tie
is a very specific requirement, and usually its "fast enough". Remember
that STDOUT is tied to the request object in mod_perl...

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org


tie question

Posted by dreamwvr <dr...@dreamwvr.com>.
hi,
   why is tie considered not very efficient i use it often.. what is 'a'
much better way?
				TIA

Re: OT XML::DOM question (used in Apache::ASP)

Posted by Matt Sergeant <ma...@sergeant.org>.
On Mon, 31 Jul 2000, Rob Tanner wrote:

> Hi,
> 
> If one can direct me to a perl modules discuss list (I don't know of any) 
> where this might be more appropriately posted, I shall be glad to oblige.
> 
> For doing XML kind of stuff, Apache::ASP uses XML-XSLT which requires 
> XML::DOM.  XML::DOM is part of libxml-enno.

This should go on the perl-xml list, hosted by ActiveState... but I'll
reply anyway...

I think XML::DOM is a bit broken WRT XML::Parser 2.29, and maybe 5.6. Enno
hasn't had time to fully update it yet. But it still works for most test
cases, and I've installed it previously by just ignoring those errors.

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org