【问题标题】:how to retrieve particular xml element in mule如何在骡子中检索特定的xml元素
【发布时间】:2015-07-15 05:08:00
【问题描述】:
<splitter evaluator="xpath" expression="/productdata/productsList" doc:name="Splitter"/> 
<transformer ref="domToXml" doc:name="Transformer Reference"/> 
<logger level="INFO" doc:name="Logger" message=" productsList...#[message.payload]" />

我输入了如下的 xml 数据。我想显示所有产品名称。上面的代码没有。任何帮助表示赞赏。

<productdata>
     <productsList>
             <product>
                 <productid>100</productid>
                 <productname>handbag</productname>
                 <desc>accessioes</desc>             
            </product>
            <product>
                   <productid>101</productid>
                 <productname>watch</productname>
                 <desc>accessioes</desc>

            </product>     
         </productsList>
         </productdata>

【问题讨论】:

    标签: mule


    【解决方案1】:

    看看xpath3 MEL 函数:http://www.mulesoft.org/documentation/display/current/Mule+Expression+Language+Reference#MuleExpressionLanguageReference-XpathandRegex

    或者xpath如果使用Mule版本http://www.mulesoft.org/documentation/display/35X/Mule+Expression+Language+Reference

    <splitter expression="#[xpath3('//productsList/product', message.payload, 'NODESET')]" />
    
    <logger level="ERROR" message=" #[xpath3('productname', payload, 'STRING')]" />
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-19
    • 1970-01-01
    • 1970-01-01
    • 2014-10-18
    • 2018-11-15
    • 1970-01-01
    相关资源
    最近更新 更多