Sign In/My Account | View Cart  
advertisement

Article:
 Introduction to dbXML
Subject: XPath query with Xindice-XMLRPC and perl
Date: 2002-06-20 02:33:22
From: Koos Fourie

(Sorry for this long entry, this is probably not even the right forum to bring this up, but I'm desperate)


I've managed to connect to Xindice via XMLRPC with perl scripts such as following:


use XMLRPC::Lite;
print XMLRPC::Lite
-> proxy('http://localhost:4080/')
-> call('db.getDocument', '/db/addressbook', "123020")
-> result;


but I can't get the db.queryCollection method (using XPath) to work, as I don't know how to pass a hashtable through perl to Xindice-XMLRPC


thus, the following code doesn't work:


use XMLRPC::Lite;
print XMLRPC::Lite
-> proxy('http://localhost:4080/')
-> call('db.queryDocument', '/db/addressbook', 'XPath', '/item', 'new Hashtable\(\)')
-> result;


(where item is the name of the root node of documents in the collection)


This produces a warning:


Use of uninitialized value in print at query.pl line 2


I get my expected result through the xindice command line call:


xindice xpath -c /db/addressbook -q /item


so I expect my xpath query is correct. I'm obviously making some stupid mistake in trying to pass the empty hashtable (I don't even know what that is), and I don't have enough experience with java and perl to solve this, and not enou. Help me. Please.


Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Oldest First
  • XPath query with Xindice-XMLRPC and perl
    2002-06-24 02:08:11 Daniel Kröger [Reply]

    Hello vleislollie (wow, this is a strange name),


    try using
    {X => "http://www.xmldb.org/xpath"} instead of your 'new Hashtable\(\)'........and no single quotes.


    This should work.


    ZeSolo

    • ZeSolo for President !!!
      2002-06-25 01:54:28 Koos Fourie [Reply]

      Thanks ZeSolo! It works like a charm.
      I was tinkering with Perl2UCS.pm in order to get some kind of connection to Java, but it seemed kinda stupid, seeing as perl already has a hashtable class. Also, you need to download a Netware client and development kit just to get to the module. Ignorance kills bandwidth.


Sponsored By: