I have a table with XMLTYPE column and the XMLEXIST works fine.
But when the root element have a xmlns atribute the XMLEXISTS don't find the record what i'm looking for.
Without the xmlns attribute the XMLEXISTS works fine.
What's wrong?
Example:
<employe>
<employe_id>12345</employe_id>
<employe_name>John</employe_name>
</employe>
The Query:
SELECT count(*) FROM mytable
WHERE XMLEXISTS('/employe[employe_id="12345"]'
PASSING xmltype_col
)
Result: 1
But with xmlns attribute on the root element the query return 0.
<employe xmlns="http://www.example.com/version_01_01_00">
<employe_id>12345</employe_id>
<employe_name>John</employe_name>
</employe>
The mytable is schemaless.
After much research, I discovered the solution.