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 Thomas Zastrow <ch...@thomas-zastrow.de> on 2003/12/08 08:07:03 UTC

Step after step ...

... I'm approaching a solution, but there is just another question :-)

With the text()-function I can access the content of a node via XPath:

xindice xpath_query -c /db/corpora/taz -q "/corpus//token[text()]"

Is it now possible to use something like pattern matches to get just some of the tags? For example:

<token>
something
</token>

To access this tag using a query like "Give me all tags which are starting with 'some'" or 
"Give me all tags that are ending with 'thing'" - or how can I solve this?

Greetings and thanks,

Tom

P.S.:
I hope that you don't think that I'm to stupid using Google or reading some books ... I have already done that more than once and was not able to get a hint how to solve this in XIndice ... all the examples I got where XSLT and doesn't work in Xindice.
And I post this message just because in the thread above with Antoine nobodys answered ...


-- 
----------------------------------------------------
| So ein Unsinn sich einer Sekte anzuschliessen    |
| wenn man Bier zuhause hat                        |
|--------------------------------------------------|                                           
| http://www.thomas-zastrow.de                     |
----------------------------------------------------

Re: Step after step ...

Posted by Thomas Zastrow <ch...@thomas-zastrow.de>.
On Mon, 8 Dec 2003 09:33:03 -0800
"Jeff Greif" <jg...@alumni.princeton.edu> wrote:

> Take a look at the XPath spec.  I think you can test for prefix, suffix and
> containment as well as equality of text, e.g.
> starts_with(text(), 'something') or contains(text(), 'something') as well as
> text()='something'


Thank you. I tried this:


[tom@tom tom]$ xindice xpath_query -c /db/corpora/taz -q "/corpus//token[contains(text(), 'D')]"
[tom@tom tom]$ xindice xpath_query -c /db/corpora/taz -q "/corpus//token[starts_with(text(), 'D')]"
[tom@tom tom]$ xindice xpath_query -c /db/corpora/taz -q "/corpus//token[text()='Dax']"


and there are a lot of tokens which contains a 'D' ... (at the beginning, in the middle and in the end) ... the result is empty. 

Sorry for asking so many questions ...

Greetings,

Tom


 


-- 
----------------------------------------------------
| So ein Unsinn sich einer Sekte anzuschliessen    |
| wenn man Bier zuhause hat                        |
|--------------------------------------------------|                                           
| http://www.thomas-zastrow.de                     |
----------------------------------------------------

Re: Step after step ...

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
Take a look at the XPath spec.  I think you can test for prefix, suffix and
containment as well as equality of text, e.g.
starts_with(text(), 'something') or contains(text(), 'something') as well as
text()='something'

Jeff
----- Original Message ----- 
From: "Thomas Zastrow" <ch...@thomas-zastrow.de>
To: <xi...@xml.apache.org>
Sent: Sunday, December 07, 2003 11:07 PM
Subject: Step after step ...


> ... I'm approaching a solution, but there is just another question :-)
>
> With the text()-function I can access the content of a node via XPath:
>
> xindice xpath_query -c /db/corpora/taz -q "/corpus//token[text()]"
>
> Is it now possible to use something like pattern matches to get just some
of the tags? For example:
>
> <token>
> something
> </token>
>
> To access this tag using a query like "Give me all tags which are starting
with 'some'" or
> "Give me all tags that are ending with 'thing'" - or how can I solve this?
>
> Greetings and thanks,
>
> Tom
>
> P.S.:
> I hope that you don't think that I'm to stupid using Google or reading
some books ... I have already done that more than once and was not able to
get a hint how to solve this in XIndice ... all the examples I got where
XSLT and doesn't work in Xindice.
> And I post this message just because in the thread above with Antoine
nobodys answered ...
>
>
> -- 
> ----------------------------------------------------
> | So ein Unsinn sich einer Sekte anzuschliessen    |
> | wenn man Bier zuhause hat                        |
> |--------------------------------------------------|
> | http://www.thomas-zastrow.de                     |
> ----------------------------------------------------
>


AW: Step after step ...

Posted by Antoine Levy-Lambert <an...@antbuild.com>.
I do not know xindice, but I would try :
xindice xpath_query -c /db/corpora/taz -q
"/corpus//token[text()='something']
Antoine
-----Ursprungliche Nachricht-----
Von: Thomas Zastrow [mailto:chef@thomas-zastrow.de]
Gesendet: Montag, 8. Dezember 2003 08:07
An: xindice-users@xml.apache.org
Betreff: Step after step ...


... I'm approaching a solution, but there is just another question :-)

With the text()-function I can access the content of a node via XPath:

xindice xpath_query -c /db/corpora/taz -q "/corpus//token[text()]"

Is it now possible to use something like pattern matches to get just some of
the tags? For example:

<token>
something
</token>

To access this tag using a query like "Give me all tags which are starting
with 'some'" or
"Give me all tags that are ending with 'thing'" - or how can I solve this?

Greetings and thanks,

Tom

P.S.:
I hope that you don't think that I'm to stupid using Google or reading some
books ... I have already done that more than once and was not able to get a
hint how to solve this in XIndice ... all the examples I got where XSLT and
doesn't work in Xindice.
And I post this message just because in the thread above with Antoine
nobodys answered ...