You can get this error while attempting to extract nodes containing a namespace prefix using a SQL expression like the following:
The problem is caused by the missing namespace parameter in the function call:
select extractValue(
xml_content,
'//openSearch:totalResults') val
from xml_documents
where id = 38;
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00601: Invalid token in: '//openSearch:totalResults'
select extractValue(Clearly the namespace declaration in green, must match the corresponding string in the source XML document.
xml_content,
'//openSearch:totalResults',
'xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/"') val
from xml_documents
where id = 38;
VAL
---
175
Note also that Oracle uses double quotes to enclose the string whereas single or double quotes might be used in the source document indifferently, what really matters is the string delimited by the quotes and do not forget that is case sensitive: a mismatching string will cause a null value to be returned instead of the expected node.
See a previous posting on problems related to default namespaces declarations and Oracle XML functions.