synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Udayanga Wickramasinghe <udaya...@wso2.com>
Subject Including Predefined namespaces for Xpath in Synapse
Date Tue, 01 Mar 2011 10:51:36 GMT
Hi devs,
Currently synapse expressions (expression="xpath" OR value={xpath} ) with
xpath needs to have namespaces declared within the element. We think it is
better to include namespaces construct at synapse.xml that any xpath
construct would be able to refer to .For example we can define ;
<namespaces>
         <namespace name="m0">http://org.sample.services</namespace>
         <namespace name="m1">http://org.sample.services</namespace>
         .......
         ....
</namespaces>

This way any expression can correspond to declared a namespace without
actually defining them in their local element;
ie:-

<callout serviceURL="https://api.sample.enp/2.0">
      <source xpath="m0:Body/child::*[fn:position()=1]  |
m1:Body/child::*[fn:position()=1]" />
      <target key="key" />
  </callout>

IMO this implementation will greatly improve readability of the
configuration. WDYT?

Regards,
Udayanga

-- 
*Udayanga Wickramasinghe*
Software Engineer; WSO2 Inc.; http://wso2.com,
*email: **udayanga@wso2.com* <udayangaw@wso2.com>* cell: +94 (77) 983-4365
blog: **http://udayangawiki.blogspot.com*<http://udayangawiki.blogspot.com/>
*
twitter: **http://twitter.com/udayanga_wick*<http://twitter.com/udayanga_wick>
*
*

Mime
View raw message