mule-user
mule-user

Reputation: 223

How to extract attribute value in XML using xpath in mule

I want to extract the value of an attribute from my xml. But I am getting null as a result. Please check if the following code snippet is correct or not.

Mule Config File

<mulexml:namespace-manager includeConfigNamespaces="false">
    <mulexml:namespace prefix="argo" uri="http://www.x.com/argo/" />
</mulexml:namespace-manager>
<flow name="kFlow">
    <file:inbound-endpoint path="C:\Users\im\Desktop" responseTimeout="10000" doc:name="File" moveToDirectory="">
        <file:filename-regex-filter pattern="ACK.xml" caseSensitive="true"/>
    </file:inbound-endpoint>
    <file:file-to-string-transformer doc:name="File to String"/>
    <logger message="#[xpath('//argo:ackTransactions/argo:ackTransaction/@argo:ediAckTransactionType').text]" level="INFO" doc:name="Logger"/>

</flow>

Upvotes: 1

Views: 1172

Answers (1)

David Dossot
David Dossot

Reputation: 33413

Use the exact same namespace:

<mulexml:namespace prefix="argo" uri="http://www.navis.com/argo" />

Upvotes: 1

Related Questions