You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by "Graaf, Edgar de (fin)" <Ed...@ordina.nl> on 2002/05/07 09:08:15 UTC

Newbie question, Usage

Hi,

Could someone please help me on my way: I have a collection with multiple
records. I wan't to have a record with a certain key. I tried the following:
.......?xpath=/functionality[@src:key="PDF"]

This give me nothing (only collections/collection with nothing in it.)

.....?xpath=/functionality
does work.

It is probably some stupid mistake but could somebody help me out.

Regards,

Edgar

Re: Newbie question, Usage

Posted by Brian Wallis <bw...@acm.org>.
For learning xpath and debugging expressions, I have found
http://www.purpletech.com/xpe/index.jsp to be very useful.


Nice little tool.

brian...

Re: Newbie question, Usage

Posted by Fernando Padilla <fe...@interdimensions.com>.
Hello.

Here are a few options to get it to work:


"xmldb:xindice://host:port/db/bugdb/PDF"
( get document, whose id is "PDF" from the "bugdb" collection )



"xmldb:xindice://host:port/db/bugdb/#/functionality[@*[name()='src:key' 
and string(.)='PDF']]"

( run the xpath ( after the # ) on the "bugdb" collection )
( the xpath states to find the functionality element that has an attribute 
named 'src:key' ( to avoid namespace issues ) and whose value is 'PDF' )



The first option, I believe is the correct option, if you're accessing it 
through an XMLDB url.  The second option, though correct XPATH, I don't 
think that it'll work because the 'src:key' attribute is generated by 
XIndice when it returns a document.  So I don't think that attribute 
exists when XIndice is running the XPATH in the database... but I could be 
mistaken.  But check it out and see!




On Tue, 7 May 2002, Graaf, Edgar de (fin) wrote:

> Hi,
> 
> Could someone please help me on my way: I have a collection with multiple
> records. I wan't to have a record with a certain key. I tried the following:
> .......?xpath=/functionality[@src:key="PDF"]
> 
> This give me nothing (only collections/collection with nothing in it.)
> 
> .....?xpath=/functionality
> does work.
> 
> It is probably some stupid mistake but could somebody help me out.
> 
> Regards,
> 
> Edgar
> 
> 



Re: Newbie question, Usage

Posted by Carsten Ziegert <ca...@ik.fh-hannover.de>.
Edgar,

could you enclose the xml document you are looking for?
How are you accessing Xindice? Via command line or Java api?



Am 07.05.2002 9:08 Uhr schrieb "Graaf, Edgar de (fin)" unter
<Ed...@ordina.nl>:

> Hi,
> 
> Could someone please help me on my way: I have a collection with multiple
> records. I wan't to have a record with a certain key. I tried the following:
> .......?xpath=/functionality[@src:key="PDF"]
> 
> This give me nothing (only collections/collection with nothing in it.)
> 
> .....?xpath=/functionality
> does work.
> 
> It is probably some stupid mistake but could somebody help me out.
> 
> Regards,
> 
> Edgar
> 


--

Medizinische Hochschule Hannover                    Fachhochschule Hannover
Abt. Hämatologie und Onkologie     FB Informations- und Kommunikationswesen
Carl-Neuberg-Straße 1                               Ricklinger Stadtweg 120
30625 Hannover                                               30459 Hannover

                           ++49-511-9296-1650
                    http://summit-bmt.fh-hannover.de