I'm trying to use a UDF to parse my xml document. If I run the following, it works:
select xpath_string('<Application><applicationId>test</applicationId></Application>', '//applicationId') as id
from my_table limit 2;
output is:
OK
test
test
If now I run the following code but add a namespace, I won't be able to parse my XML:
select xpath_string('<Application xmlns="http://domain.com/test"><applicationId>test</applicationId></Application>', '//applicationId') as id
from my_table limit 2;
I will only get empty strings.
Is there anything that I am doing wrong? Or should I improve my XPath?
Thanks!