[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: querying XML documents with Xpath and the "contains" function



On Wed, 17 Jan 2001 09:52:58 +0100
Mamei Marco <Marco.Mamei@CSELT.IT> wrote:
> Hi,
> I read the W3C specifications about Xpath, and I find a very interesting
> function, that can be used
> to build predicates like [position()=1]. The function is "contains", and
> it
> can be used to determine if
> a stirng contains another string. Now using that fuction associated with
> the
> text element of the document, should provide somethig like a full-text
> search engine in Ozone. Moreover it allows to take into consideration
> the
> semantic markup
> of the document itself, because for exemple I can look for a word in a
> text
> element only if it is inside a particular tag.
> Unfortunately I couldn't understand the syntax of this command form the
> W3C
> spec, have you ever tried this command?

Hi Marco,

you may have a look at the XPath queries in the Prowler live demo at
http://www.smb-tec.com:7070 . There's one query using the 'contains'
function.

Regarding full text search with XPath, one can use it for that, but I
don't think it would work well. First you need some sort of indexing
mechanism and an XPath processor supporting it (which does currently not
exist AFAIK, at least as Open Source). Second, XPath is not very suited to
search text spanning multiple nodes e.g.

a <b>simple</b> text

If one wants to search for 'a simple text', writing an XPath query which
covers all posibilities of text-tag-combination would be painfull (if not
even impossible).

Of course it would be great having full text search for XML documents, but
I don't think XPath is the way to go. (If somebody proves the opposite, I
would be happy to change my mind ;-)

best regards,

Conny Krappatsch


-- 
______________________________________________________________________
Conny Krappatsch                              mailto:conny@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com