小飛哥

          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 小飛哥 閱讀(1641) 評論(0)  編輯  收藏 所屬分類: camel


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


          網站導航:
           

          My Links

          News

          常用鏈接

          隨筆分類

          最新隨筆

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 茂名市| 伊宁县| 聂拉木县| 通许县| 沅陵县| 邵东县| 长岭县| 泾阳县| 五河县| 额敏县| 黔南| 钟祥市| 工布江达县| 门源| 凌云县| 合作市| 呼玛县| 长葛市| 慈利县| 阿拉善右旗| 涞源县| 图片| 静乐县| 宝山区| 五寨县| 金阳县| 绥中县| 蓬安县| 辰溪县| 鄯善县| 旬邑县| 肥东县| 东乌珠穆沁旗| 秦皇岛市| 镇雄县| 微博| 麻城市| 鲁甸县| 泾阳县| 灵武市| 沁水县|