problem using for loop in function

Oxygen general issues.
GeertsP
Posts: 1
Joined: Fri Jul 31, 2009 11:46 am

problem using for loop in function

Post by GeertsP »

Hello,

I am trying to access a secondary source document from within a Xquery function. As follows:

-------------------------------------
declare function kzf:make-observations2 ($recipient as element(*,v1:CaregroupcourseParticipant))
as element(hl7:component)* {

for $i in (doc("file:///C:/HISKIS/exe/CIM/v2/wsdls/EvT v0.3.xml")/messageComposition/messageDef)

return
<component>
<observation classCode="OBS" moodCode="EVN">
<id root="1.2.34.5.7968694845657694"/>
<code code="{data($i/id/@extension)}" codeSystem="2.16.840.1.113883.6.1" displayName="Bloedglucosewaarden nuchter"/>
<effectiveTime value="200904021044"/>
<value xsi:type="PQ" value="5.5" unit="mmol/l"/>
</observation>
</component>

};
------------------------------------

This code is validated succesfully and executed however the code attribute value remains empty "".
If I extract this code and execute it in (main)standalone xquery file it gives the results I expect.

What am I missing out here ?

any suggestions ?

Thanks

Peter Geerts
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: problem using for loop in function

Post by sorin_ristache »

Hello,

Post a complete XQuery that includes calling the function kzf:make-observations2 and the file EvT v0.3.xml for reproducing the problem.


Regards,
Sorin
Post Reply