From: trubliphone <tru...@go...> - 2011-04-18 19:30:26
|
Hello, Apologies if this is a newbie question. I am getting very confused with namespaces and eXist / XQuery. Suppose I have a set of documents in my exist collection that take the following form: one.xml: <foo id="1"> <one>one</one> <two>two</two> </foo> two.xml: <foo id="2"> <one>one</one> <two>two</two> </foo> three.xml: <foo id="3"> <one>one</one> <two>two</two> </foo> I have enabled searching on <foo> in my "collections.xconf" file using the following line. If I search for the text "one," I get the expected results: All three documents match. However, if I add a default namespace declaration to one of the files: one.xml: <foo id="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.one.com"> <one>one</one> <two>two</two> </foo> Then it no longer matches. This makes sense, I guess, because the lucene index and my search code is looking for <foo> and not the fully-qualified element. However, the situation is more complicated than this, because the real documents can potentially all have different namespaces. Is there anyway, programatically in XQuery, to handle this? Thank you very much for your help. |