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 Dirk Bromberg <br...@tzi.de> on 2002/08/13 08:52:40 UTC
xpath question
hi,
if i have an document like this:
<ico>
<id>423234</id>
<keywords>
<keyword>Haus</keyword>
<keyword>Baum</keyword>
<keyword>Auto</keyword>
<keyword>Boot</keyword>
<keyword>Sonne</keyword>
</keywords>
<faws>
<faw>Meier</faw>
<faw>Müller</faw>
<faw>Bremen</faw>
<faw>Winter</faw>
<faw>Boot</faw>
<faw>PC</faw>
</faws>
<author>Heiner Meier</author>
<words>502</words>
<date>19082002</date>
</ico>
how can i search all documents with:
((any keyword= Haus OR any keyword = Auto) AND (author = Heiner Meier )
AND NOT (id = 423234))
is it possible the get all documents with "words greater than 500" ? or
does the indexer not work here ?
thx
Dirk Bromberg
Re: xpath question
Posted by Terry Rosenbaum <Te...@amicas.com>.
Dirk Bromberg wrote:
How do I search for documents where...
> ((any keyword= Haus OR any keyword = Auto) AND (author = Heiner Meier )
> AND NOT (id = 423234))
The xpaths shown below (between the single quotes) should do what you want:
'/db/ico/keywords/keyword[.="Haus" or .="Auto"]/../../author[.="Heiner Meier"]/../id[.!="423234"]/..'
> words greater than 500
'/db/ico/words[.>500]/..'
To try out your xpaths, use the ApplyXPath example that comes with xalan-j.
-Terry
Dirk Bromberg wrote:
>hi,
>
>if i have an document like this:
>
><ico>
> <id>423234</id>
> <keywords>
> <keyword>Haus</keyword>
> <keyword>Baum</keyword>
> <keyword>Auto</keyword>
> <keyword>Boot</keyword>
> <keyword>Sonne</keyword>
> </keywords>
> <faws>
> <faw>Meier</faw>
> <faw>Müller</faw>
> <faw>Bremen</faw>
> <faw>Winter</faw>
> <faw>Boot</faw>
> <faw>PC</faw>
> </faws>
> <author>Heiner Meier</author>
> <words>502</words>
> <date>19082002</date>
></ico>
>
>how can i search all documents with:
>
>((any keyword= Haus OR any keyword = Auto) AND (author = Heiner Meier )
>AND NOT (id = 423234))
>
>
>is it possible the get all documents with "words greater than 500" ? or
>does the indexer not work here ?
>
>thx
>
>Dirk Bromberg
>
>
>
AW: xpath question
Posted by Dirk Bromberg <br...@tzi.de>.
thanks for quick answer.
Dirk Bromberg
-----Ursprüngliche Nachricht-----
Von: Carsten Ziegert [mailto:carsten.ziegert@ik.fh-hannover.de]
Gesendet: Dienstag, 13. August 2002 09:04
An: Mailing List dbXML
Betreff: Re: xpath question
Am 13.08.2002 8:52 Uhr schrieb "Dirk Bromberg" unter <br...@tzi.de>:
> hi,
>
> if i have an document like this:
>
> <ico>
> <id>423234</id>
> <keywords>
> <keyword>Haus</keyword>
> <keyword>Baum</keyword>
> <keyword>Auto</keyword>
> <keyword>Boot</keyword>
> <keyword>Sonne</keyword>
> </keywords>
> <faws>
> <faw>Meier</faw>
> <faw>Müller</faw>
> <faw>Bremen</faw>
> <faw>Winter</faw>
> <faw>Boot</faw>
> <faw>PC</faw>
> </faws>
> <author>Heiner Meier</author>
> <words>502</words>
> <date>19082002</date>
> </ico>
>
> how can i search all documents with:
>
> ((any keyword= Haus OR any keyword = Auto) AND (author = Heiner Meier
> ) AND NOT (id = 423234))
>
xindice xpath -c coll -q '/ico[(//keyword="Haus" or //keyword="Auto")
and author="Heiner Meier" and not id="423234]'
author and id are nested only one level under ico, whereas keyword is
nested two levels under the root ico, so XPath will work with "//"
(meaning "arbitrary level")
>
> is it possible the get all documents with "words greater than 500" ?
> or does the indexer not work here ?
see: http://www.zvon.org/xxl/XPathTutorial/General/examples.html
Carsten
--
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
Re: xpath question
Posted by Carsten Ziegert <ca...@ik.fh-hannover.de>.
Am 13.08.2002 8:52 Uhr schrieb "Dirk Bromberg" unter <br...@tzi.de>:
> hi,
>
> if i have an document like this:
>
> <ico>
> <id>423234</id>
> <keywords>
> <keyword>Haus</keyword>
> <keyword>Baum</keyword>
> <keyword>Auto</keyword>
> <keyword>Boot</keyword>
> <keyword>Sonne</keyword>
> </keywords>
> <faws>
> <faw>Meier</faw>
> <faw>Müller</faw>
> <faw>Bremen</faw>
> <faw>Winter</faw>
> <faw>Boot</faw>
> <faw>PC</faw>
> </faws>
> <author>Heiner Meier</author>
> <words>502</words>
> <date>19082002</date>
> </ico>
>
> how can i search all documents with:
>
> ((any keyword= Haus OR any keyword = Auto) AND (author = Heiner Meier )
> AND NOT (id = 423234))
>
xindice xpath -c coll -q '/ico[(//keyword="Haus" or //keyword="Auto")
and author="Heiner Meier" and not id="423234]'
author and id are nested only one level under ico, whereas keyword is
nested two levels under the root ico, so XPath will work with "//"
(meaning "arbitrary level")
>
> is it possible the get all documents with "words greater than 500" ? or
> does the indexer not work here ?
see: http://www.zvon.org/xxl/XPathTutorial/General/examples.html
Carsten
--
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