Problem: INPATH doesnt work as expected [message #76120] |
Wed, 08 September 2004 05:32 |
Dave Castonguay
Messages: 1 Registered: September 2004
|
Junior Member |
|
|
Hi everyone,
i need your help on something i ran into yesterday.
Consider the following XML that is the content of XMLType field in our novels db:
<record>
<leader>01127nam 2200385 a 4500</leader>
<controlfield tag="001">0000795331</controlfield>
<controlfield tag="005">20040816135746.0</controlfield>
<controlfield tag="008">010402s2000 fr f fre </controlfield>
--- more fields here not revelant to our case ----
<datafield tag="100" ind1="1" ind2=" ">
<subfield code="a">Lord, Jeffrey.</subfield>
</datafield>
<datafield tag="245" ind1="1" ind2="4">
<subfield code="a">Les affins d'Oniris /</subfield>
<subfield code="c">Jeffrey Lord ; adapté de l'américain par Yves Chéraqui.</subfield>
</datafield>
--- more fields here not revelant to our case ----
</record>
Now when i execute the following query (either from SQL+ or from Java):
select rowid,r.notice
from roman r where CONTAINS(notice,' (roch and carrier INPATH(/record/datafield[[@tag="245"]]/subfield[[@code="a"]]))')>0
As you see, the constraint check for a value on a particular path that is a subfield with an attribute code=a that is a child of a datafield with an attribute tag=245.
So, the previous XML record shouldn't be returned when i execute the query, but it is. It's look like the the INPATH is done also on subfield with attribute code="c" which contains the values "roch and carrier".
I ve done test changing the query INPATH to something like: /record/datafield[[@tag=245]]/subfield[[@code="Z"]]
Like expected, no rows are returned, because there's no subield with an attribute code="Z".
So why, my query expands the INPATH constraint to unspecified element?
Is it just my query that is badly build (im still a newbie with Oracle XML and Text)?
Any help/advices will be welcome!
Have a nice day!
Dave
|
|
|