logo       

Re: XML::LibXSLT registered functions: a preliminary fix: msg#00033

lang.perl.xml

Subject: Re: XML::LibXSLT registered functions: a preliminary fix

At 14:25 +0100 12/11/03, Robin Berjon wrote:
Elizabeth Mattijsen wrote:
This serves my purposes for the time being. But I wonder whether this is the right thing to do. On the one hand, you would only use this module if you're actually using registered functions. On the other hand, I feel this should be in integral part of XML:::LibXML and XML::LibXSLT. But that would mean an overhead to the destruction of XML::LibXML::Node objects that is not generally needed.
This rocks! :)

Thank you... ;-)


Personally I don't mind either way: I still like the idea of having registered functions work just the same for LibXSLT and XPathContext

Well, I posted a message about this about 10 days ago or so: from what I understood there is that LibXSLT and XPathContext are two different modules, with two different approaches and never the twain shall meet.


...and that requires loading a module anyway so loading yours too would be fine by me.

Hmmm... on the other hand, maybe the whole "register_function" functionality should be taken out of the standard XML::LibXSLT module and put in XML::LibXSLT::Functions ? Then you would have less to load if you're not using registered functions, and you would always have correctly functioning registered functions if you want to (by also using XML::LibXSLT::Functions).


I guess the question could also be: at the end of a document's life, do all individual nodes get DESTROYed or only those that are directly referenced from Perl?

I think only the ones referenced from Perl. By specifying the nodeset as a parameter to the Perl function, somewhere under the hood an XML::LibXML::NodeList object is created (which in turn contains other XML::LibXML::xxx objects). However, these objects refer to data-structures that I think are not strictly "theirs". Which causes the problem when they're destroyed: they're freeing data-structures in libxml which are not supposed to be freed yet.


... If all, then how high is the overhead for each? A DOM typically contains a lot of nodes, and even a small overhead for each could be a big one overall.

But that would not be the case: it would only be applicable to Perl objects: and a DOM would be a single object with a single DESTROY. So I think the overhead would be


Just my ¤2/100, thanks for doing this Liz!

Well, I had an itch to scratch (for a customer)... ;-)


Liz

_______________________________________________
Perl-XML mailing list
Perl-XML@xxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise