The third namespace attribute (xmlns = "urn: hl7-org: v3") binds the default namespace.
The syntax for defining a default namespace for elements in XQuery is:
declare default element namespace "urn:hl7-org:v3";
However, overriding the default element namespace prevents your query from being validated for nodes without a namespace!
The best way to do this is to possibly associate a new prefix with this namespace:
declare namespace xsd = "http://www.w3.org/2001/XMLSchema"; declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance"; declare namespace h17 = "urn:h17-org:v3"; for $x in doc("/db/HL7/cda2.xml")/h17:ClinicalDocument/h17:name return $x/h17:family
Oliver hallam
source share