Just importing the following XML fragment into a new database. It is not queriable for some reason.
The following do not return anything: //representedOrganization db:open("item","item.xml")/document db:open("item","item.xml")/document/author/assignedEntity/representedOrganization
----- item.xml <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="http://www.fda.gov/oc/datacouncil/stylesheets/spl/spl.xsl" type="text/xsl"?> <document xmlns:voc="http://www.hl7.org/v3/voc" xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://www.fda.gov/oc/datacouncil/schemas/spl/spl.xsd"> <id root="ABD6ECF0-DC8E-41DE-89F2-1E36ED9D6535"/> <code code="34391-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="HUMAN PRESCRIPTION DRUG LABELING"/> <title mediaType="text/x-hl7-title+xml">RENESE<sup>®</sup> <br/> <br/>(polythiazide)<br/> <br/>TABLETS<br/> <br/>for Oral Administration</title> <effectiveTime value="20051214"/> <setId root="ABD6ECF0-DC8E-41DE-89F2-1E36ED9D6535"/> <versionNumber value="1"/> <author> <time/> <assignedEntity> <representedOrganization> <name>Pfizer Labs</name> </representedOrganization> </assignedEntity> </author> </document>
Hi Oliver,
your document includes namespaces which you will have to declare for accessing these items.
declare namespace h17 = "urn:hl7-org:v3";
db:open("item","item.xml")/h17:document db:open("item","item.xml")/h17:document/h17:author/h17:assignedEntity/h17:representedOrganization
Alternatively, you can declare the default namespace and use the queries you've got:
declare default element namespace "urn:hl7-org:v3";
Kind regards from Lake Constance, Germany, Jens
basex-talk@mailman.uni-konstanz.de