notice: using the contains() is slows the search! Dirk
-----Urspr�ngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 11. Juli 2002 12:57 An: [email protected] Cc: [EMAIL PROTECTED] Betreff: RE: contains Hi Erick, Your attributes should be quoted to be valid XML e.g. <BBB att="bar"> not <BBB att=bar> <AAA id="doc1"> <BBB att="foo"> Text part for doc1. </BBB> <CCC/> </AAA> <AAA id="doc2"> <BBB att="bar"> Text part for doc2. </BBB> <CCC/> </AAA> Try this xpath: //*[contains(BBB,'for doc2')] or if you're only checking AAA nodes, use the more efficient XPath: AAA[contains(BBB,'doc2')] Used via XPath Query service, this will match the node <AAA id="doc2"> ...</AAA> -- Peter -----Original Message----- From: Erick Briere [mailto:[EMAIL PROTECTED] Sent: 11 July 2002 12:13 To: [email protected] Subject: xf:contains Hy, I found in the W3C "XQuery 1.0 and XPath 2.0 Functions and Operators" ( http://www.w3.org/TR/xquery-operators/ ) a "xf:contains" function (http://www.w3.org/TR/xquery-operators/#func-contains) : is it implemented in the xpath parser of xindice ? If yes, can somebody give me the syntax of the query ? In other words, I would like to search for documents whose text contains something (no really need of a fulltext search engine, but need a bit more than only node retrieval, based on attributes values). Example: consider the 2 documents: <AAA id="doc1"> <BBB att=foo> Text part for doc1. </BBB> <CCC/> </AAA> <AAA id="doc2"> <BBB att=bar> Text part for doc2. </BBB> <CCC/> </AAA> How can i find ' the document whose node BBB contains "for doc2" ' ? Thanks for help, Erick.
