Dabbling with WSO2 ESB example http://wso2.org/library/articles/2011/01/wso2-esb-example-file-processing but encountering a problem where when a simple csv file
name0,value0
name1,value1
name2,value2
name3,value3
is parsed by smooks using this configuration
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:csv="http://www.milyn.org/xsd/smooks/csv-1.1.xsd">
<csv:reader fields="name,value" />
</smooks-resource-list>
results in largely the correct output but the first line includes the payload namespace which is incorrect
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<text xmlns="http://ws.apache.org/commons/ns/payload">name0,value0
name1,value1
name2,value2
name3,value3</text>
</soapenv:Body>
</soapenv:Envelope>
so when the first name0 value is read it includes the which is also incorrect.
Smooks then converts this into
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<csv-set>
<csv-record number="1">
<name><?xml version='1.0' encoding='utf-8'?><text xmlns="http://ws.apache.org/commons/ns/payload">name0</name>
<value>value0</value>
</csv-record>
<csv-record number="2">
<name>name1</name>
<value>value1</value>
</csv-record>
<csv-record number="3">
<name>name2</name>
<value>value2</value>
</csv-record>
<csv-record number="4">
<name>name3</name>
<value>value3</text></value>
</csv-record>
</csv-set>
</soapenv:Body>
</soapenv:Envelope>
So is Smooks doing all it is asked as the input includes the the as last? However, the number of elements it understands are counted as 4 so it isn't as if the csv is supposed to have a header row. I can resolve (to a certain extent) by including a header row but then the element count is incorrect. I can resolve the end closing by just including a carriage return on the last line of csv.
How can I resolve this? I have found one other thread a year ago asking the same question but no answers.