简体   繁体   中英

how to create an output file based on xml data in mule

Im very new to mule so hopefully someone out there can help me out. Im trying to create an output based on a content in my xml Ex

<Header>
   <UniqueID>AAA_12345</UniqueID>
</Header>

Id like the filename to be the the UniqueID ie AAA_1245.xml

I found a few syntax on the net but it doesnt work for me. My syntax is

<file:outbound-endpoint path="${cwMessagesPath}/out" outputPattern="#[xpath:/Header/UniqueID].xml" connector-ref="cwksbDefaultFileConnector" />

for some reason, mule creates #[xpath: as a directory, Header as another directory and then the filename as UniqueID].xml

Im using mule 2.2.1

Thanks for your help.

This should work.

Is cwksbDefaultFileConnector configured in any specific manner?

Also, I think in Mule 2 it was possible to configure other placeholders than #[ ] for expressions. Are expressions working with this syntax elsewhere in your application? If yes, then the problem is different.

Do you run standalone or embedded? If embedded, make sure you have the mule-module-xml dependency in your project's POM.

Finally, what is the payload type of the message that hits the file:outbound-endpoint ? Maybe some manual transformation is needed in Mule 2 before using XPath.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM