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 "Vorbau, Alex" <al...@hp.com> on 2002/04/16 02:02:30 UTC
XPATH won't query CDATA?
Hi,
I'm testing out Xindice to see if it meets the needs of our project. I
loaded it with 3,000 XML files and tried some XPATH queries. I've noticed a
couple problems, so I'm hoping that I'm just not using it correctly.
* a substring search ( i.e. contains() ) results in a linear search which
takes about 40-60 sec, regardless of any indexers that are set. I saw a
reference to this problem in an earlier message, but I wondering if this
will be addressed soon.
* more importantly, an XPATH query of the exact contents of an element that
is wrapped in CDATA returns nothing.
For example if there's an element like this:
<foo>
<bar><![CDATA[Bert & Ernie]]></bar>
</foo>
The XPATH query
//foo[bar = 'Bert & Ernie']"
returns nothing. So does this:
//foo[bar = '<![CDATA[Bert & Ernie]]>']"
Could this be true? I hope I'm missing something because non-support for
CDATA is definitely a showstopper for us.
TIA for you help,
Alex
-----
Alex Vorbau
HP Labs, Nomadic Computing Dept.
650-857-3050
alex_vorbau@hp.com
Re: XPATH won't query CDATA?
Posted by Carsten Ziegert <ca...@ik.fh-hannover.de>.
I often use XPath queries searching for CDATA and it works
when using the form
//foo[bar='Ernie']
Maybe the ampersand is the cause for retrieving nothing.
Am 16.04.2002 2:18 Uhr schrieb "Mark J. Stang" unter
<ma...@earthlink.net>:
> The contains() is a linear search and doesn't use indexes. There was talk
> of adding in a search for all the text. I haven't tried the CDATA searches
> yet...
>
> hth,
>
> Mark
>
> "Vorbau, Alex" wrote:
>
>> Hi,
>>
>> I'm testing out Xindice to see if it meets the needs of our project. I
>> loaded it with 3,000 XML files and tried some XPATH queries. I've noticed a
>> couple problems, so I'm hoping that I'm just not using it correctly.
>>
>> * a substring search ( i.e. contains() ) results in a linear search which
>> takes about 40-60 sec, regardless of any indexers that are set. I saw a
>> reference to this problem in an earlier message, but I wondering if this
>> will be addressed soon.
>>
>> * more importantly, an XPATH query of the exact contents of an element that
>> is wrapped in CDATA returns nothing.
>>
>> For example if there's an element like this:
>> <foo>
>> <bar><![CDATA[Bert & Ernie]]></bar>
>> </foo>
>>
>> The XPATH query
>> //foo[bar = 'Bert & Ernie']"
>> returns nothing. So does this:
>> //foo[bar = '<![CDATA[Bert & Ernie]]>']"
>>
>> Could this be true? I hope I'm missing something because non-support for
>> CDATA is definitely a showstopper for us.
>>
>> TIA for you help,
>>
>> Alex
>>
>> -----
>> Alex Vorbau
>> HP Labs, Nomadic Computing Dept.
>> 650-857-3050
>> alex_vorbau@hp.com
>
>
--
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 won't query CDATA?
Posted by "Mark J. Stang" <ma...@earthlink.net>.
The contains() is a linear search and doesn't use indexes. There was talk
of adding in a search for all the text. I haven't tried the CDATA searches
yet...
hth,
Mark
"Vorbau, Alex" wrote:
> Hi,
>
> I'm testing out Xindice to see if it meets the needs of our project. I
> loaded it with 3,000 XML files and tried some XPATH queries. I've noticed a
> couple problems, so I'm hoping that I'm just not using it correctly.
>
> * a substring search ( i.e. contains() ) results in a linear search which
> takes about 40-60 sec, regardless of any indexers that are set. I saw a
> reference to this problem in an earlier message, but I wondering if this
> will be addressed soon.
>
> * more importantly, an XPATH query of the exact contents of an element that
> is wrapped in CDATA returns nothing.
>
> For example if there's an element like this:
> <foo>
> <bar><![CDATA[Bert & Ernie]]></bar>
> </foo>
>
> The XPATH query
> //foo[bar = 'Bert & Ernie']"
> returns nothing. So does this:
> //foo[bar = '<![CDATA[Bert & Ernie]]>']"
>
> Could this be true? I hope I'm missing something because non-support for
> CDATA is definitely a showstopper for us.
>
> TIA for you help,
>
> Alex
>
> -----
> Alex Vorbau
> HP Labs, Nomadic Computing Dept.
> 650-857-3050
> alex_vorbau@hp.com