Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-03-01 Thread Christian Glahn
On Sun, 2004-02-29 at 19:42, Michael Kröll wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Matt Sergeant wrote:
> | All working now, and checked into CVS.
> :-)
> 
> | I guess it's probably time for a new release.
> There are calls to xmlCleanupParser() now in LibXSLT.xs - Christian
> removed these calls around parser calls from LibXML.xs. Should they be
> removed from LibXSLT.xs as well and replaced by the same logic as found
> in LibXML_cleanup_callbacks() in LibXML.xs?

This is correct. 

xmlCleanupParser() as well as xmlInitParser(), must get used only once.
While xmlInitParser() may not cause too much harm (?),
xmlCleanupParser() frees all global/static memory for the parser as
documented in the libxml2 docs.

Michael and me discussed this issue a few days ago.

The attached patch corrects the existing cvs code.

Christian
--- LibXSLT.xs.orig 2004-03-01 17:31:26.0 +0100
+++ LibXSLT.xs  2004-03-01 17:41:13.0 +0100
@@ -702,7 +702,6 @@
 XSRETURN_UNDEF;
 }
 
-xmlInitParser();
 xmlRegisterInputCallbacks((xmlInputMatchCallback) LibXSLT_input_match,
   (xmlInputOpenCallback) LibXSLT_input_open,
   (xmlInputReadCallback) LibXSLT_input_read,
@@ -720,7 +719,8 @@
 }
 RETVAL = xsltParseStylesheetDoc(doc_copy);
 
-xmlCleanupParser();
+xmlCleanupInputCallbacks();
+xmlRegisterDefaultInputCallbacks();
 
 if (RETVAL == NULL) {
 XSRETURN_UNDEF;
@@ -735,7 +735,6 @@
 PREINIT:
 char * CLASS = "XML::LibXSLT::Stylesheet";
 CODE:
-xmlInitParser();
 xmlRegisterInputCallbacks((xmlInputMatchCallback) LibXSLT_input_match,
   (xmlInputOpenCallback) LibXSLT_input_open,
   (xmlInputReadCallback) LibXSLT_input_read,
@@ -749,7 +748,8 @@
 }
 RETVAL = xsltParseStylesheetFile(filename);
 
-xmlCleanupParser();
+xmlCleanupInputCallbacks();
+xmlRegisterDefaultInputCallbacks();
 
 if (RETVAL == NULL) {
 XSRETURN_UNDEF;
@@ -802,13 +802,15 @@
 else {
 xsltSetGenericDebugFunc(NULL, NULL);
 }
-xmlInitParser();
 xmlRegisterInputCallbacks((xmlInputMatchCallback) LibXSLT_input_match,
   (xmlInputOpenCallback) LibXSLT_input_open,
   (xmlInputReadCallback) LibXSLT_input_read,
   (xmlInputCloseCallback) LibXSLT_input_close);
 real_dom = xsltApplyStylesheet(self, doc, xslt_params);
-xmlCleanupParser();
+
+xmlCleanupInputCallbacks();
+xmlRegisterDefaultInputCallbacks();
+
 if (real_dom == NULL) {
 if (SvTRUE(ERRSV)) {
 croak("Exception occurred while applying stylesheet: %s", SvPV(ERRSV, 
len));

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Richard Leopold
On Sun, Feb 29, 2004 at 09:54:07PM +, Matt Sergeant wrote:
> On Sun, 29 Feb 2004, Richard Leopold wrote:
> > But where I can find it ? The cvs.apache.org doesn't seem to hold the
> > newest version.
> 
> It's the XML-LibXML project on axkit.org's CVS. See the page on the
> axkit.org website for access details.

I already found it ;) Seems my problem is fixed. Thanks for your work !

Regards - Richard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LibXSLT document function broken in axkit

2004-02-29 Thread Richard Leopold
On Sun, Feb 29, 2004 at 09:10:39PM +0100, Kjetil Kjernsmo wrote:
> I should leave the answer to that question to others, but I think it is 
> relevant which version of libxml2 you are using. I guess it is 2.6.6-1?

yes, that's the version, but it doesn't matter ... 

> If I have understood the earlier discussion here correctly, it is the 
> 2.6 versions that are problematic. Thus, I compiled 2.5.10 from a 
> source package of 2003-06-01, which is the latest version that the 
> XML::LibXML README file mentions as being tested. I've got some debs, 
> you can have them if you want, but they were my first debs ever (except 
> for linux kernels), so no warranties... :-) Also, I just removed them 
> and upgraded myself, because they conflict with the recent KDE 3.1.5 
> packages (and 3.2 in experimental), and with Matt's enthusiastic "All 
> working" message, I figured it was time to upgrade. 

Thanks for the offer, but I also look forward to the "All working" versions
freshly submitted to the CVS on axkit.org. - Yes I've found it ! So I checked 
out the new XML::LibXML, XML::LibXSLT and build some debs from it.
You can find them on 
http://www.0n3.org/~leo/debian/dists/unstable/
... but also no warranties ;)

My problem is fixed: the "axkit:/"-URI passed to the document() function 
works now !

- Richard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Matt Sergeant
On Sun, 29 Feb 2004, Richard Leopold wrote:

> But where I can find it ? The cvs.apache.org doesn't seem to hold the
> newest version.

It's the XML-LibXML project on axkit.org's CVS. See the page on the
axkit.org website for access details.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LibXSLT document function broken in axkit

2004-02-29 Thread Kjetil Kjernsmo
On Sunday 29 February 2004 20:46, Richard Leopold wrote:
> > All working now, and checked into CVS.
> >
> > I guess it's probably time for a new release.
>
> Hm - seem's to like the problem I was strumble on. I'm using the
> unstable packages of Debian: Axkit (1.6.2) and XML::LibXML (1.56). -
> older versions for you ;)

I should leave the answer to that question to others, but I think it is 
relevant which version of libxml2 you are using. I guess it is 2.6.6-1?

If I have understood the earlier discussion here correctly, it is the 
2.6 versions that are problematic. Thus, I compiled 2.5.10 from a 
source package of 2003-06-01, which is the latest version that the 
XML::LibXML README file mentions as being tested. I've got some debs, 
you can have them if you want, but they were my first debs ever (except 
for linux kernels), so no warranties... :-) Also, I just removed them 
and upgraded myself, because they conflict with the recent KDE 3.1.5 
packages (and 3.2 in experimental), and with Matt's enthusiastic "All 
working" message, I figured it was time to upgrade. 

Cheers,

Kjetil
-- 
Kjetil Kjernsmo
Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer
[EMAIL PROTECTED]  [EMAIL PROTECTED]  [EMAIL PROTECTED]
Homepage: http://www.kjetil.kjernsmo.net/OpenPGP KeyID: 6A6A0BBC


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Richard Leopold
On Sun, Feb 29, 2004 at 06:19:54PM +, Matt Sergeant wrote:
> > OK, I locally have document() working (and xsl:include/import) with local
> > files just not file:/// full paths. It's a good start... Working on
> > file:/// now.
> 
> All working now, and checked into CVS.
> 
> I guess it's probably time for a new release.

Hm - seem's to like the problem I was strumble on. I'm using the unstable
packages of Debian: Axkit (1.6.2) and XML::LibXML (1.56). - older versions
for you ;)

I'm in trouble with 'axkit:'-URIs given to the document() function.
The open_uri/open_cb callback result is the correct string, but the
called stylesheet->transform breaks like:

"axkit:/content/2003-08-23_expose.dbk.meta:1:  at
 /usr/lib/perl5/Apache/AxKit/Language/LibXSLT.pm line 124."

With relative URIs and absolutes to the docroot document() works fine!
... running through the open_cb !

Now I hope the _actual_ CVS version smashes my problem ...

But where I can find it ? The cvs.apache.org doesn't seem to hold the
newest version.

Regards - Richard



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Michael Kröll
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Matt Sergeant wrote:
| All working now, and checked into CVS.
:-)
| I guess it's probably time for a new release.
There are calls to xmlCleanupParser() now in LibXSLT.xs - Christian
removed these calls around parser calls from LibXML.xs. Should they be
removed from LibXSLT.xs as well and replaced by the same logic as found
in LibXML_cleanup_callbacks() in LibXML.xs?
michael

- --
IT ServicesUniversity of Innsbruck
063A F25E B064 A98F A479  1690 78CD D023 5E2A 6688
http://zis.uibk.ac.at/.m/uibk.ac.at_pgp_pubkey.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
iD8DBQFAQjKEeM3QI14qZogRAkxmAKD0BLFQI3aBZfLhsKX2HvkjgxAbCgCghIZJ
voWoEcxeyrsNSi/YLPFBif0=
=mN8Z
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Matt Sergeant
On Sun, 29 Feb 2004, Matt Sergeant wrote:

> On Sun, 29 Feb 2004, [ISO-8859-1] Michael Kröll wrote:
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > Matt Sergeant wrote:
> > |>That patch should be enough. I tested it and it worked.
> > |>Which version of XML::LibXML are you using? Christian commited updates
> > |>to the callback handling in LibXML.xs two days ago and I did not test
> > |>the LibXSLT.xs patch with that.
> > | This is CVS of XML::LibXML.
> >
> > Just tested it with the current CVS version of XML::LibXML. The results
> > perpetuate the seemingly neverending story: With the CVS version of
> > XML::LibXSLT neither xsl:import, xsl:include nor document() work because
> > the callbacks are not used. With the patched CVS version, xsl:import and
> > xsl:include do work, but document() does NOT.
> >
> > So still no current version combination of XML::Lib* and libx* that is
> > fully functional :-(
>
> OK, I locally have document() working (and xsl:include/import) with local
> files just not file:/// full paths. It's a good start... Working on
> file:/// now.

All working now, and checked into CVS.

I guess it's probably time for a new release.

-- 

<:->get a SMart net
I am Jack's broken heart.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Matt Sergeant
On Sun, 29 Feb 2004, [ISO-8859-1] Michael Kröll wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Matt Sergeant wrote:
> |>That patch should be enough. I tested it and it worked.
> |>Which version of XML::LibXML are you using? Christian commited updates
> |>to the callback handling in LibXML.xs two days ago and I did not test
> |>the LibXSLT.xs patch with that.
> | This is CVS of XML::LibXML.
>
> Just tested it with the current CVS version of XML::LibXML. The results
> perpetuate the seemingly neverending story: With the CVS version of
> XML::LibXSLT neither xsl:import, xsl:include nor document() work because
> the callbacks are not used. With the patched CVS version, xsl:import and
> xsl:include do work, but document() does NOT.
>
> So still no current version combination of XML::Lib* and libx* that is
> fully functional :-(

OK, I locally have document() working (and xsl:include/import) with local
files just not file:/// full paths. It's a good start... Working on
file:/// now.

-- 

<:->get a SMart net
I am Jack's broken heart.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Michael Kröll
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Matt Sergeant wrote:
|>That patch should be enough. I tested it and it worked.
|>Which version of XML::LibXML are you using? Christian commited updates
|>to the callback handling in LibXML.xs two days ago and I did not test
|>the LibXSLT.xs patch with that.
| This is CVS of XML::LibXML.
Just tested it with the current CVS version of XML::LibXML. The results
perpetuate the seemingly neverending story: With the CVS version of
XML::LibXSLT neither xsl:import, xsl:include nor document() work because
the callbacks are not used. With the patched CVS version, xsl:import and
xsl:include do work, but document() does NOT.
So still no current version combination of XML::Lib* and libx* that is
fully functional :-(
michael

- --
IT ServicesUniversity of Innsbruck
063A F25E B064 A98F A479  1690 78CD D023 5E2A 6688
http://zis.uibk.ac.at/.m/uibk.ac.at_pgp_pubkey.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
iD8DBQFAQiLheM3QI14qZogRAsURAKDoWDFyqxxQK5njq97bjJulrFQKFACbBw8K
Puev0GmvJ0W77FcED8FqIYQ=
=T6f2
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Matt Sergeant
From: "Michael Kröll" <[EMAIL PROTECTED]>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Matt Sergeant wrote:
> | So I applied this, and still don't have a working document() function
> | unless I specify the full path. Am I missing something? A patch to AxKit
> | itself perhaps???
> That patch should be enough. I tested it and it worked.
> Which version of XML::LibXML are you using? Christian commited updates
> to the callback handling in LibXML.xs two days ago and I did not test
> the LibXSLT.xs patch with that.

This is CVS of XML::LibXML.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Michael Kröll
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Matt Sergeant wrote:
| So I applied this, and still don't have a working document() function
| unless I specify the full path. Am I missing something? A patch to AxKit
| itself perhaps???
That patch should be enough. I tested it and it worked.
Which version of XML::LibXML are you using? Christian commited updates
to the callback handling in LibXML.xs two days ago and I did not test
the LibXSLT.xs patch with that.
michael

- --
IT ServicesUniversity of Innsbruck
063A F25E B064 A98F A479  1690 78CD D023 5E2A 6688
http://zis.uibk.ac.at/.m/uibk.ac.at_pgp_pubkey.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
iD8DBQFAQgcTeM3QI14qZogRAojvAKCzKxDBNqpxWOP56jS/Rf06J0ae2QCgtZzM
sPDiYDuQAPFb743TYwtCrYs=
=hsY5
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [xml-libxml] Re: LibXSLT document function broken in axkit

2004-02-29 Thread Matt Sergeant
On Thu, 19 Feb 2004, [ISO-8859-15] Michael Kröll wrote:

> (2) Enable input callbacks for XML::LibXSLT
>
> With an active "xmlCleanupParser();" line (as its currently the status
> in LibXML.xs) all the AxKit callbacks are cleared at the last parsing
> action in Apache::AxKit::Language::LibXSLT ($style->get_dom()) and no
> callback is set anymore when XML::LibXSLT->parse_stylesheet() is called.
> The attached patches for LibXSLT.pm and LibXSLT.xs activate explicit
> input callback handling for XML::LibXSLT and with it, they enable
> friendly co-existence of AxKit and other XML::LibXML apps in one Apache
> installation again.

So I applied this, and still don't have a working document() function
unless I specify the full path. Am I missing something? A patch to AxKit
itself perhaps???

-- 

<:->get a SMart net
I am Jack's broken heart.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LibXSLT document function broken in axkit

2004-02-20 Thread Petr Pajas
Michael Kröll <[EMAIL PROTECTED]> writes:

> | From LibXML perspective, you should probably change your patch so that
> | no LibXSLT internal method uses LibXML_ prefix. (In fact, it is
> | necessary to make sure that symbols from LibXML and LibXSLT have
> | different names.
> Those LibXML_input* methods in the patch are plain copies of the ones in
> LibXML.xs. I don't know much about XS - aren't there ways to reuse those
> methods?

If there is any, I'd like to learn about that too. As a quick
solution, I suggest simply renaming them (and all references to them)
to LibXSLT_input*

/p


pgp0.pgp
Description: PGP signature


Re: LibXSLT document function broken in axkit

2004-02-20 Thread Petr Pajas
Michael Kröll <[EMAIL PROTECTED]> writes:

> With that patch, I cannot reproduce the behaviour as described in
> http://aspn.activestate.com/ASPN/Mail/Message/perl-xml/1998065 anymore.
> The error shows up again with an active "xmlCleanupParser();" line (See
> (http://axkit.org/cgi-bin/viewcvs.cgi/XML-LibXML/LibXML.xs.diff?r1=1.166&r2=1.167)
> for the changes causing the callback problems).
> As I do not know why exactly xmlInitParser(); is needed not to mess up
> things, it very likely would be safe not to ommit xmlCleanupParser(),
> even if I cannot reproduce the error in a
> mod_perl+AxKit+otherXML::LibXML-app environment with ommiting it.

xmlCleanupParser is once called in END(). Maybe this is sufficient,
but since neither of us (or at least I) don't understand it deeply
enough to see all the consequences, I'm quite reluctant to commit it.

> Therefore I looked for another option to solve the problem:
>
> (2) Enable input callbacks for XML::LibXSLT

This looks better to me, but I think can't commit to LibXSLT. I don't
know much of LibXSLT history, but I wonder what was the original
reason for removal of callbacks from LibXSLT?  ("callbacks() never
worked and has been removed." doesn't say too much - what's "never
work" supposed to mean?). If there was some reason, you should clarify
that it doesn't apply to your solution. In other words, make sure
re-adding them won't break other things.

From LibXML perspective, you should probably change your patch so that
no LibXSLT internal method uses LibXML_ prefix. (In fact, it is
necessary to make sure that symbols from LibXML and LibXSLT have
different names. Otherwise it might lead to problems on some
platforms, such as OS X/Darwin).

/p


pgp0.pgp
Description: PGP signature


Re: LibXSLT document function broken in axkit

2004-02-20 Thread Michael Kröll
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Petr Pajas wrote:
| Maybe this is sufficient,
| but since neither of us (or at least I) don't understand it deeply
| enough to see all the consequences
Me neither. Also, I do not really understand why exactly and since when
xmlInitParser() is neccessary now, as it was not in earlier versions of
libxml...
| This looks better to me, but I think can't commit to LibXSLT. I don't
| know much of LibXSLT history, but I wonder what was the original
| reason for removal of callbacks from LibXSLT?  ("callbacks() never
| worked and has been removed." doesn't say too much - what's "never
| work" supposed to mean?).
Matt can probably tell us.
| From LibXML perspective, you should probably change your patch so that
| no LibXSLT internal method uses LibXML_ prefix. (In fact, it is
| necessary to make sure that symbols from LibXML and LibXSLT have
| different names.
Those LibXML_input* methods in the patch are plain copies of the ones in
LibXML.xs. I don't know much about XS - aren't there ways to reuse those
methods?
michael

- --
IT ServicesUniversity of Innsbruck
063A F25E B064 A98F A479  1690 78CD D023 5E2A 6688
http://zis.uibk.ac.at/.m/uibk.ac.at_pgp_pubkey.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFANgrEeM3QI14qZogRAlGEAKDbjWeCJXanU0oXFGGh9YM5sVR+/wCg7u2c
6LTUnB7JcQEVpZW4QNNHySs=
=Hp/B
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: LibXSLT document function broken in axkit

2004-02-19 Thread Michael Kröll
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Petr Pajas wrote:
| behind the problems and what's wrong with the patch? Also, could
| anyone who uses LibXML with AxKit examine this in more detail and try
| to find a solution suitable for both camps?  I'd be very happy to
| commit it to the CVS then.
I did some experiments and came up with two options to have a solution
for both camps:
(1) Apply noxmlcleanupparser.patch to LibXML.xs

With that patch, I cannot reproduce the behaviour as described in
http://aspn.activestate.com/ASPN/Mail/Message/perl-xml/1998065 anymore.
The error shows up again with an active "xmlCleanupParser();" line (See
(http://axkit.org/cgi-bin/viewcvs.cgi/XML-LibXML/LibXML.xs.diff?r1=1.166&r2=1.167)
for the changes causing the callback problems).
As I do not know why exactly xmlInitParser(); is needed not to mess up
things, it very likely would be safe not to ommit xmlCleanupParser(),
even if I cannot reproduce the error in a
mod_perl+AxKit+otherXML::LibXML-app environment with ommiting it.
Therefore I looked for another option to solve the problem:
(2) Enable input callbacks for XML::LibXSLT

With an active "xmlCleanupParser();" line (as its currently the status
in LibXML.xs) all the AxKit callbacks are cleared at the last parsing
action in Apache::AxKit::Language::LibXSLT ($style->get_dom()) and no
callback is set anymore when XML::LibXSLT->parse_stylesheet() is called.
The attached patches for LibXSLT.pm and LibXSLT.xs activate explicit
input callback handling for XML::LibXSLT and with it, they enable
friendly co-existence of AxKit and other XML::LibXML apps in one Apache
installation again.
RFC,
Michael
- --
IT ServicesUniversity of Innsbruck
063A F25E B064 A98F A479  1690 78CD D023 5E2A 6688
http://zis.uibk.ac.at/.m/uibk.ac.at_pgp_pubkey.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
iD8DBQFANJyieM3QI14qZogRAoXDAKDv/lTzGnH5uU9cLWq5S/FmVN5kBQCfcNut
sd9TlAyFVgHEaIRUg9ZWK00=
=zM5S
-END PGP SIGNATURE-
Index: LibXML.xs
===
RCS file: /home/cvs/XML-LibXML/LibXML.xs,v
retrieving revision 1.169
diff -u -b -r1.169 LibXML.xs
--- LibXML.xs   2004/02/18 18:53:07 1.169
+++ LibXML.xs   2004/02/19 09:12:09
@@ -796,7 +796,6 @@
 if (LibXML_old_ext_ent_loader != NULL ) {
 xmlSetExternalEntityLoader( 
(xmlExternalEntityLoader)LibXML_old_ext_ent_loader );
 }
-xmlCleanupParser();
 }
 
 void
Index: LibXSLT.pm
===
RCS file: /home/cvs/XML-LibXSLT/LibXSLT.pm,v
retrieving revision 1.46
diff -u -r1.46 LibXSLT.pm
--- LibXSLT.pm  2003/02/12 16:48:02 1.46
+++ LibXSLT.pm  2004/02/19 11:07:33
@@ -1,5 +1,4 @@
 # $Id: LibXSLT.pm,v 1.46 2003/02/12 16:48:02 matt Exp $
-
 package XML::LibXSLT;
 
 use strict;
@@ -35,11 +34,11 @@
 my $func = shift;
 my @params = @_;
 my @perlParams;
-
+
 my $i = 0;
 while (@params) {
 my $type = shift(@params);
-if ($type eq 'XML::LibXML::Literal' or 
+if ($type eq 'XML::LibXML::Literal' or
 $type eq 'XML::LibXML::Number' or
 $type eq 'XML::LibXML::Boolean')
 {
@@ -53,7 +52,7 @@
 unshift(@perlParams, $type->new(@nodes));
 }
 }
-
+
 $func = "main::$func" unless ref($func) || $func =~ /(.+)::/;
 no strict 'refs';
 my $res = $func->(@perlParams);
@@ -72,7 +71,7 @@
 }
 else {
 if ($value =~ s/'/', "'", '/g) {
-   $results[-1] = "concat('$value')";
+$results[-1] = "concat('$value')";
 }
 else {
 $results[-1] = "'$results[-1]'";
@@ -83,46 +82,75 @@
 }
 
 sub callbacks {
-die "callbacks() never worked and has been removed."
+my $self = shift;
+if (@_) {
+my ($match, $open, $read, $close) = @_;
+
+$self->{XML_LIBXSLT_MATCH} = $match ;
+$self->{XML_LIBXSLT_OPEN} = $open ;
+$self->{XML_LIBXSLT_READ} = $read ;
+$self->{XML_LIBXSLT_CLOSE} = $close ;
+}
+else {
+return
+$self->{XML_LIBXSLT_MATCH},
+$self->{XML_LIBXSLT_OPEN},
+$self->{XML_LIBXSLT_READ},
+$self->{XML_LIBXSLT_CLOSE};
+}
 }
 
 sub match_callback {
-die "match_callback never worked and has been removed.\nPlease set 
\$XML::LibXML::match_cb instead";
+my $self = shift;
+$self->{XML_LIBXSLT_MATCH} = shift if scalar @_;
+return $self->{XML_LIBXSLT_MATCH};
 }
 
 sub open_callback {
-die "open_callback never worked and has been removed.\nPlease set 
\$XML::LibXML::open_cb instead";
+my $self = shift;
+$self->{XML_LIBXSLT_OPEN} = shift if scalar @_;
+return $self->{XML_LIBXSLT_OPEN};
 }
 
 sub read_callback {
-die "read_callback never worked and has been removed.\nPlease set 
\$XML::LibXML::read_cb instead";
+my $self = shift;
+$self->{XML_LIBXSLT_READ} = shift if scalar @_;
+

Re: LibXSLT document function broken in axkit

2004-02-17 Thread Petr Pajas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sorry for posting the same again: [EMAIL PROTECTED] was misspelled
in Michael's original mail.

Michael Kröll <[EMAIL PROTECTED]> writes:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Matthew Smith wrote:
> | I have a simple document() test case that fails in AxKit but not in
> | LibXSLT stand alone.
> |
> | The perl script gives the correct output on my system using
> | LibXML 1.57 (cvs)
> Unfortunately, the patch to version 1.167 of LibXML.xs
> (http://axkit.org/cgi-bin/viewcvs.cgi/XML-LibXML/LibXML.xs.diff?r1=1.166&r2=1.167)
> reactivated the callback problems we experienced before 1.165
> :-/

Hm, what problems are those? 

I applied the patch because it was requested by several AxKit users
and I was persuaded it was quite harmless. I'm not personally using
XML-LibXML in combination with AxKit, so I can't check what is the
real cause of the problem. Could you, please, explain to me, what's
behind the problems and what's wrong with the patch? Also, could
anyone who uses LibXML with AxKit examine this in more detail and try
to find a solution suitable for both camps?  I'd be very happy to
commit it to the CVS then.

> So, if you remove the two lines xmlInitParser(); and xmlCleanupParser();
> the AxKit callbacks should work again but you may experience random
> "could not find stylesheet" error messages from your httpd children as
> reported in http://aspn.activestate.com/ASPN/Mail/Message/perl-xml/1997443

/petr

> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.2.1 (MingW32)
>
> iD8DBQFAMgrGeM3QI14qZogRAhp3AKDqHpMeQXFNuHb0WfVCAtPrQN/GFQCeJXIx
> vtjp/9Z5ClDc+eJgSLwA2Xw=
> =6PQO
> -END PGP SIGNATURE-
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 

iD8DBQFAMhLkQfxdLDi03+IRAjZQAJ9CX2DeseJjSwkzL0JlseCFbxHeAQCcCmaP
WCImpQ+SWv0XmUB5BW8byAY=
=PQct
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LibXSLT document function broken in axkit

2004-02-17 Thread Petr Pajas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Michael Kröll <[EMAIL PROTECTED]> writes:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Matthew Smith wrote:
> | I have a simple document() test case that fails in AxKit but not in
> | LibXSLT stand alone.
> |
> | The perl script gives the correct output on my system using
> | LibXML 1.57 (cvs)
> Unfortunately, the patch to version 1.167 of LibXML.xs
> (http://axkit.org/cgi-bin/viewcvs.cgi/XML-LibXML/LibXML.xs.diff?r1=1.166&r2=1.167)
> reactivated the callback problems we experienced before 1.165
> :-/

Hm, what problems are those? 

I applied the patch because it was requested by several AxKit users
and I was persuaded it was quite harmless. I'm not personally using
XML-LibXML in combination with AxKit, so I can't check what is the
real cause of the problem. Could you, please, explain to me, what's
behind the problems and what's wrong with the patch? Also, could
anyone who uses LibXML with AxKit examine this in more detail and try
to find a solution suitable for both camps?  I'd be very happy to
commit it to the CVS then.

> So, if you remove the two lines xmlInitParser(); and xmlCleanupParser();
> the AxKit callbacks should work again but you may experience random
> "could not find stylesheet" error messages from your httpd children as
> reported in http://aspn.activestate.com/ASPN/Mail/Message/perl-xml/1997443

/petr

> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.2.1 (MingW32)
>
> iD8DBQFAMgrGeM3QI14qZogRAhp3AKDqHpMeQXFNuHb0WfVCAtPrQN/GFQCeJXIx
> vtjp/9Z5ClDc+eJgSLwA2Xw=
> =6PQO
> -END PGP SIGNATURE-

- -- 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 

iD8DBQFAMhHBQfxdLDi03+IRApS9AKCaVZc3XAGYVRIUlzd8Ed1TKYl5XACePZIt
xmunBRUjDoKbDceVKkkCf5U=
=t0o1
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: LibXSLT document function broken in axkit

2004-02-17 Thread Michael Kröll
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Matthew Smith wrote:
| I have a simple document() test case that fails in AxKit but not in
| LibXSLT stand alone.
|
| The perl script gives the correct output on my system using
| LibXML 1.57 (cvs)
Unfortunately, the patch to version 1.167 of LibXML.xs
(http://axkit.org/cgi-bin/viewcvs.cgi/XML-LibXML/LibXML.xs.diff?r1=1.166&r2=1.167)
reactivated the callback problems we experienced before 1.165
:-/
So, if you remove the two lines xmlInitParser(); and xmlCleanupParser();
the AxKit callbacks should work again but you may experience random
"could not find stylesheet" error messages from your httpd children as
reported in http://aspn.activestate.com/ASPN/Mail/Message/perl-xml/1997443
:-/
michael

- --
IT ServicesUniversity of Innsbruck
063A F25E B064 A98F A479  1690 78CD D023 5E2A 6688
http://zis.uibk.ac.at/.m/uibk.ac.at_pgp_pubkey.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (MingW32)
iD8DBQFAMgrGeM3QI14qZogRAhp3AKDqHpMeQXFNuHb0WfVCAtPrQN/GFQCeJXIx
vtjp/9Z5ClDc+eJgSLwA2Xw=
=6PQO
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]