Skip Menu |

This queue is for tickets about the XML-ExistDB CPAN distribution.

Report information
The Basics
Id: 59046
Status: resolved
Priority: 0/
Queue: XML-ExistDB

People
Owner: Nobody in particular
Requestors: Bastian.Entrup [...] germanistik.uni-giessen.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: maybe a little bug with downloadDocument
Date: Fri, 2 Jul 2010 11:44:36 +0200
To: bug-XML-ExistDB [...] rt.cpan.org
From: Bastian Entrup <Bastian.Entrup [...] germanistik.uni-giessen.de>
Hi! First of all, thumbs up, I'm working with the xml::exist-db for a few days now, and I really like all the options it gives me. But I've got a little Problem with the downloadDocument() method. I'm trying to download xml-files i want to parse with XML::Libxml. This is what i'm doing: my $eXistDB = XML::eXistDB::RPC->new(destination => "http://$hostname:$port/exist/xmlrpc", user => "$user", password => "$password", repository => '/db',); my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/hamlet.xml"); print $doc; and for hamlet.xml the module returns: "No method matching arguments: java.lang.String, java.lang.String". First I thought it might be something wrong with the eXist installation, but I check it, it's ok (I tried 2 different ones). A bit strange: if i try my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/macbeth.xml"); it woks and returns the content of macbeth.xml. Am I making a mistake? I tried a lot, but still could find a way to download the files, that why I thought there might be a Problem with the module. If not, if I'm only to stupid to work with it, I'm sorry to bother you! Best regards, Bastian
Subject: Re: [rt.cpan.org #59046] maybe a little bug with downloadDocument
Date: Fri, 2 Jul 2010 12:21:42 +0200
To: Bastian Entrup via RT <bug-XML-ExistDB [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Bastian Entrup via RT (bug-XML-ExistDB@rt.cpan.org) [100702 09:45]: Show quoted text
> Fri Jul 02 05:45:09 2010: Request 59046 was acted upon. > Transaction: Ticket created by Bastian.Entrup@germanistik.uni-giessen.de > Queue: XML-ExistDB > Subject: maybe a little bug with downloadDocument > > First of all, thumbs up, I'm working with the xml::exist-db for a few > days now, and I really like all the options it gives me.
Great... I still didn't find time to play with my own module ;-) Show quoted text
> my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/hamlet.xml"); > print $doc;
You mean ($rc, $doc) = $db->downloadDocument() ? Show quoted text
> and for hamlet.xml the module returns: "No method matching arguments: java.lang.String, java.lang.String". First I thought it might be something wrong with the eXist installation, but I check it, it's ok (I tried 2 different ones).
Show quoted text
> A bit strange: if i try > my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/macbeth.xml"); > it woks and returns the content of macbeth.xml.
This looks like an internal bug of existdb: it is a part of an Java error you show me. Does hamlet.xml exist? Can you sent me the whole java stack trace? -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #59046] maybe a little bug with downloadDocument
Date: Tue, 6 Jul 2010 19:16:56 +0200
To: bug-XML-ExistDB [...] rt.cpan.org
From: Bastian Entrup <Bastian.Entrup [...] germanistik.uni-giessen.de>
Hi! sorry, but there is no java stack trace, only the snippet I sent you. But a friend of mine ran a few tests and the Problem seems to be the file-size (I think it's the same chunk size problems that occurs with $obj->getDocumentData(RESOURCE, FORMAT) ). Up to 5552 lines of xml code are fine, bigger files run into this problem. This is the environment we're running: Client: - perl v5.10.0 - XML::eXistDB v0.11 - XML::Compile v1.15 - XML::LibXML v1.70 Server: - eXist v1.4.0 Build 20091111 SVN Revision 10440 - Java v1.6.0-20 I would be even better if retrieveResults() would return a XML::LibXML-object instead of a hash. in this case i could query the files with xquery and woulnd't need downloadDocument() at all. best regards, Bastian Am 02.07.2010 um 12:21 schrieb Mark Overmeer via RT: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=59046 > > > * Bastian Entrup via RT (bug-XML-ExistDB@rt.cpan.org) [100702 09:45]:
>> Fri Jul 02 05:45:09 2010: Request 59046 was acted upon. >> Transaction: Ticket created by Bastian.Entrup@germanistik.uni-giessen.de >> Queue: XML-ExistDB >> Subject: maybe a little bug with downloadDocument >> >> First of all, thumbs up, I'm working with the xml::exist-db for a few >> days now, and I really like all the options it gives me.
> > Great... I still didn't find time to play with my own module ;-) >
>> my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/hamlet.xml"); >> print $doc;
> > You mean ($rc, $doc) = $db->downloadDocument() ? >
>> and for hamlet.xml the module returns: "No method matching arguments: java.lang.String, java.lang.String". First I thought it might be something wrong with the eXist installation, but I check it, it's ok (I tried 2 different ones).
>
>> A bit strange: if i try >> my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/macbeth.xml"); >> it woks and returns the content of macbeth.xml.
> > This looks like an internal bug of existdb: it is a part of an Java > error you show me. Does hamlet.xml exist? Can you sent me the whole > java stack trace? > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net >
Subject: Re: [rt.cpan.org #59046] maybe a little bug with downloadDocument
Date: Tue, 6 Jul 2010 19:18:38 +0200
To: bug-XML-ExistDB [...] rt.cpan.org
From: Bastian Entrup <Bastian.Entrup [...] germanistik.uni-giessen.de>
Hi! sorry, but there is no java stack trace, only the snippet I sent you. But a friend of mine ran a few tests and the Problem seems to be the file-size (I think it's the same chunk size problems that occurs with $obj->getDocumentData(RESOURCE, FORMAT) ). Up to 5552 lines of xml code are fine, bigger files run into this problem. This is the environment we're running: Client: - perl v5.10.0 - XML::eXistDB v0.11 - XML::Compile v1.15 - XML::LibXML v1.70 Server: - eXist v1.4.0 Build 20091111 SVN Revision 10440 - Java v1.6.0-20 I would be even better if retrieveResults() would return a XML::LibXML-object instead of a hash. in this case i could query the files with xquery and woulnd't need downloadDocument() at all. best regards, Bastian Am 02.07.2010 um 12:21 schrieb Mark Overmeer via RT: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=59046 > > > * Bastian Entrup via RT (bug-XML-ExistDB@rt.cpan.org) [100702 09:45]:
>> Fri Jul 02 05:45:09 2010: Request 59046 was acted upon. >> Transaction: Ticket created by Bastian.Entrup@germanistik.uni-giessen.de >> Queue: XML-ExistDB >> Subject: maybe a little bug with downloadDocument >> >> First of all, thumbs up, I'm working with the xml::exist-db for a few >> days now, and I really like all the options it gives me.
> > Great... I still didn't find time to play with my own module ;-) >
>> my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/hamlet.xml"); >> print $doc;
> > You mean ($rc, $doc) = $db->downloadDocument() ? >
>> and for hamlet.xml the module returns: "No method matching arguments: java.lang.String, java.lang.String". First I thought it might be something wrong with the eXist installation, but I check it, it's ok (I tried 2 different ones).
>
>> A bit strange: if i try >> my $doc = $eXistDB->downloadDocument("/db/shakespeare/plays/macbeth.xml"); >> it woks and returns the content of macbeth.xml.
> > This looks like an internal bug of existdb: it is a part of an Java > error you show me. Does hamlet.xml exist? Can you sent me the whole > java stack trace? > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net >
Subject: Re: [rt.cpan.org #59046] maybe a little bug with downloadDocument
Date: Fri, 16 Jul 2010 09:57:53 +0200
To: Bastian Entrup via RT <bug-XML-ExistDB [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Bastian Entrup via RT (bug-XML-ExistDB@rt.cpan.org) [100706 17:18]: Show quoted text
> Queue: XML-ExistDB > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=59046 > > > sorry, but there is no java stack trace, only the snippet I sent > you. But a friend of mine ran a few tests and the Problem seems to be > the file-size (I think it's the same chunk size problems that occurs > with $obj->getDocumentData(RESOURCE, FORMAT) ). Up to 5552 lines of xml > code are fine, bigger files run into this problem.
(late response because of holiday, I will depart for three weeks again this Sunday) Probably, this is a problem with my chunk handling. I would really like to know what is wrong. Show quoted text
> I would be even better if retrieveResults() would return a > XML::LibXML-object instead of a hash. in this case i could query the > files with xquery and woulnd't need downloadDocument() at all.
I do not understand this. Why is this keeping you back from using xquery? The xquery question will produce a small document which returns the answer to your question, which gets decoded as field in the HASH as returned by retrieveResults(). It has nothing to do with returning XML::LibXML nodes or HASHes IMO. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #59046] maybe a little bug with downloadDocument
Date: Fri, 16 Jul 2010 10:17:44 +0200
To: bug-XML-ExistDB [...] rt.cpan.org
From: Bastian Entrup <Bastian.Entrup [...] germanistik.uni-giessen.de>
Hi! The scripts I wrote work with libxml-objects. so I would need either a libxml-object or the file which then could be parsed by libxml. If I'd use the hash that xquery returns, I would have to change 600 lines of code, but i there's no other solution, maybe I have to switch to xquery. I wish you nice holidays, I'm leaving on monday for three weeks too, hope to hear from you in august! best regards, Bastian Am 16.07.2010 um 09:58 schrieb Mark Overmeer via RT: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=59046 > > > * Bastian Entrup via RT (bug-XML-ExistDB@rt.cpan.org) [100706 17:18]:
>> Queue: XML-ExistDB >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=59046 > >> >> sorry, but there is no java stack trace, only the snippet I sent >> you. But a friend of mine ran a few tests and the Problem seems to be >> the file-size (I think it's the same chunk size problems that occurs >> with $obj->getDocumentData(RESOURCE, FORMAT) ). Up to 5552 lines of xml >> code are fine, bigger files run into this problem.
> > (late response because of holiday, I will depart for three weeks again > this Sunday) > > Probably, this is a problem with my chunk handling. I would really > like to know what is wrong. >
>> I would be even better if retrieveResults() would return a >> XML::LibXML-object instead of a hash. in this case i could query the >> files with xquery and woulnd't need downloadDocument() at all.
> > I do not understand this. Why is this keeping you back from using > xquery? The xquery question will produce a small document which returns > the answer to your question, which gets decoded as field in the HASH > as returned by retrieveResults(). It has nothing to do with returning > XML::LibXML nodes or HASHes IMO. > -- > Regards, > MarkOv > > ------------------------------------------------------------------------ > Mark Overmeer MSc MARKOV Solutions > Mark@Overmeer.net solutions@overmeer.net > http://Mark.Overmeer.net http://solutions.overmeer.net >
Subject: Re: [rt.cpan.org #59046] maybe a little bug with downloadDocument
Date: Fri, 16 Jul 2010 10:56:59 +0200
To: Bastian Entrup via RT <bug-XML-ExistDB [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Bastian Entrup via RT (bug-XML-ExistDB@rt.cpan.org) [100716 08:18]: Show quoted text
> Queue: XML-ExistDB > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=59046 > > > The scripts I wrote work with libxml-objects. so I would need either a > libxml-object or the file which then could be parsed by libxml. If I'd > use the hash that xquery returns, I would have to change 600 lines of > code, but i there's no other solution, maybe I have to switch to xquery.
You should do as much as possible on the server side: downloading a document actually means that the server first needs to rebuild the whole document for you: documents are stored as parsed tree. When make the query to produce a small result, it will be much more efficient on the server and less communication. Of course, you can also base your code on XML::Compile::RPC::Client directly. You may also extend XML::eXistDB with methods which do not decode the answers. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Thread ended