Based on "Using the XML Exchange" here: http://qpid.apache.org/books/0.16/Programming-In-Apache-Qpid/html/section-addresses.html [root@deathstar2 mrg-tutorials]# cat rdu.query let $w := ./weather return $w/station = 'Raleigh-Durham International Airport (KRDU)' and $w/temperature_f > 50 and $w/temperature_f - $w/dewpoint > 5 and $w/wind_speed_mph > 7 and $w/wind_speed_mph < 20 drain -f "myxml; {link:{x-bindings:[{key:'weather',arguments:{xquery:\"$(cat rdu.query )\"}}]}}" produces a huge error, ending with: File "/usr/lib/python2.6/site-packages/qpid/messaging/address.py", line 71, in tok2obj return eval(tok.value) File "<string>", line 1 "let $w := ./weather ^ SyntaxError: EOL while scanning string literal Additionally, the program here: http://deathstar1.usersys.redhat.com:8080/TopicIndex/Books/editor/preview.html?skyneturl=http://skynet.usersys.redhat.com:8080/TopicIndex&topicid=10208 Does not work.
The python client appears not to accept newlines in string literals within addresses. Your example program looks to me like it needs to set the subject on the message being sent to 'weather'.
Now working: [root@deathstar1 tmp]# python weather.py myxmlq; {create: always, link: {x-bindings: [{exchange: myxml, key: weather, arguments: {xquery: "let $w := ./weather return $w/station = 'Raleigh-Durham International Airport (KRDU)' and $w/temperature_f > 50 and $w/temperature_f - $w/dewpoint > 5 and $w/wind_speed_mph > 7 and $w/wind_speed_mph < 20"}}]}} Message(subject=u'weather', properties={u'qpid.subject': u'weather', 'x-amqp-0-10.routing-key': u'weather'}, content='<weather><station>Raleigh-Durham International Airport (KRDU)</station><wind_speed_mph>16</wind_speed_mph><temperature_f>70</temperature_f><dewpoint>35</dewpoint></weather>')
The general xml demo that was using the xquery saved in the file and cat command was rewritten to python. The demo is functional. Content approved. -> VERIFIED