Bob,

That is the answer to a different question. Amir wants the 'person' not the person's phone.

I added the xml file to a collection of mine, ran your query and got the person returned. You must be doing something else wrong. The problem is not with the query.

Are you querying the collection which contains that XML file? Do a 'lc' and a 'ld' command to verily that the xml file is in the collection you believe it to be in.

Your collection parameter would not work for me - this can depend on how you are accessing Xindice. I have it set up on port 8081 and refer to the collection as:

 -c xmldb:xindice://localhost:8081/db/test

where the test xml file has been placed in the collection 'test'.

Good luck,
/Neil

Bob Corcoran wrote:
Try: /person/[EMAIL PROTECTED]'home']
-----Original Message-----
From: Amir Saad [mailto:[EMAIL PROTECTED] Sent: Monday, February 27, 2006 4:23 AM
To: xindice-users@xml.apache.org
Subject: XPath Problem

I have Xindice version 1 running on WinXP
I tried to execute the XPath query mentioned in the documentation but no
result although there are matching entries.
here is the file I added to the collection:
<?xml version="1.0"?>
  <person>
    <fname>John</fname>
    <lname>Smith</lname>
    <phone type="work">563-456-7890</phone>
<phone type="home">534-567-8901</phone> <email type="home">[EMAIL PROTECTED]</email>
    <email type="work">[EMAIL PROTECTED]</email>
    <address type="home">34 S. Colon St.</address>
    <address type="work">9967 W. Shrimp Ave.</address>
  </person>
and here is the XPath query: xindice xpath -c /db/addressbook -q "/person[phone/@type='home']" I hope you can help,
Thanks
Amir Saad
Software Engineer


Reply via email to