小飛哥

          camel with xquery

          myTransform.xquery文件:
          <persons>
          {
            for $b in (persons/person)
            return
              if($b/age>20)
              then
              <man>
               {$b/firstName}
              </man>
              else
              ""
          }   
          </persons>
          message.xml
          <persons>
          <person user="james">
            <firstName>James</firstName>
            <lastName>Strachan</lastName>
            <city>London</city>
            <age>20</age>
          </person>
          <person user="xiaofei">
            <firstName>xiaofei</firstName>
            <lastName>liu</lastName>
            <city>ShangHai</city>
            <age>23</age>
          </person>
          <person user="tony">
            <firstName>tony</firstName>
            <lastName>liu</lastName>
            <city>ShangHai</city>
            <age>23</age>
          </person>
          </persons>
          camelcontext.xml:
          <route>
                <from uri="file:src/data?noop=true"/>
                <to uri="xquery:myTransform.xquery"/>
            <to uri="file:target/outputFiles"/>
              </route>

          out:
          <persons>
           <man>
            <firstName>xiaofei</firstName>
           </man>
           <man>
            <firstName>tony</firstName>
           </man>
          </persons>

          posted on 2010-02-01 11:10 小飛哥 閱讀(1637) 評論(0)  編輯  收藏 所屬分類: camel


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           

          My Links

          News

          常用鏈接

          隨筆分類

          最新隨筆

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 胶州市| 玛曲县| 樟树市| 浪卡子县| 营山县| 宁武县| 沂源县| 桐乡市| 柘城县| 罗源县| 邯郸县| 长顺县| 富顺县| 东安县| 昆山市| 兴和县| 中超| 桐庐县| 阿巴嘎旗| 怀来县| 钦州市| 扎赉特旗| 确山县| 印江| 荥阳市| 道真| 交口县| 沾化县| 岚皋县| 穆棱市| 鄂州市| 云阳县| 西贡区| 常熟市| 溧阳市| 二连浩特市| 玛沁县| 云阳县| 恩平市| 湖口县| 洪湖市|