I need to fetch the <TITLE>
element from the following XML using XQuery (I'm using eXist-db).
<?xml-stylesheet href="shakes.xsl" type="text/xsl"?>
<!--!DOCTYPE PLAY PUBLIC "-//PLAY//EN" "play.dtd"-->
<ClinicalDocument xmlns="urn:hl7-org:v3">
<PLAY>
<TITLE>The Tragedy of Hamlet, Prince of Denmark</TITLE>
</PLAY>
</ClinicalDocument >
When I try with the XQuery below I am not getting the expected output.
xquery version "3.0";
doc("/db/apps/demo/data/hamlet.xml")/ClinicalDocument/PLAY/TITLE
I think the problem is related to the xmlns
attribute present in the <ClinicalDocument>
tag:
<ClinicalDocument xmlns="urn:hl7-org:v3">
How can I modify my XQuery to retrieve the desired XML element?