Re: XPath Problem
Neil Cook <[email protected]> Mon, 27 Feb 2006 09:45:42 -0500
| Newsgroups | gmane.text.xml.xindice.user |
|---|---|
| Message-ID | <[email protected]> |
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/phone[@type='home'] > -----Original Message----- > From: Amir Saad [mailto:[email protected]] > Sent: Monday, February 27, 2006 4:23 AM > To: [email protected] > 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 > >