xml - XPath-Query with wildcard not working -


it driving me crazy.

can tell me why query not work:

xquery version "3.0"; $item in collection("openkernel/openehr_ehr/archetyped/") let $uid:=$item//uid/value $uid="51160740-171e-487c-a04d-eae267f7079a" return $item 

must stupid, know. double slash before //uid/value because want use query generic

the xml-document trying find resides in collection, , this:

<openehr-ehr_rm-composition.composition.v1 xmlns="http://rosa.openkernel/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://rosa.openkernel/ file:/openehr-ehr_rm-composition.composition.v1.xsd"> <composition archetype_id="openehr-ehr_rm-composition.composition.v1">     <archetype_id>         <value>openehr-ehr_rm-composition.composition.v1</value>     </archetype_id>     <category>         <defining_code>             <code_string>431</code_string>             <terminology_id>                 <value>openehr</value>             </terminology_id>         </defining_code>         <value>persistent</value>     </category>     <something>a composition</something>     <uid>         <value>0e15d0f2-0b59-4df7-88f8-27be87e1e2ac</value>     </uid>     <content archetype_id="openehr-ehr_rm-admin_entry.admin_entry.v1" archetype_node_id="at0002">         <archetype_id>             <value>openehr-ehr_rm-admin_entry.admin_entry.v1</value>         </archetype_id>         <an_item>nono</an_item>         <an_other_item>an_other_item</an_other_item>         <something>an admin_entry</something>         <uid>             <value>51160740-171e-487c-a04d-eae267f7079a</value>         </uid>     </content> </composition> </openehr-ehr_rm-composition.composition.v1> 

thanks, bert

you need take namespace account, see http://www.w3.org/tr/xquery/#id-default-namespace:

declare default element namespace "http://rosa.openkernel/"; 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -