Hi,
I don't have a xsd schema to validate the xml file. I only need to make sure
that there is no malformation in the whole xml, in that case if the xml is
malformed i have a option to stop from futher processing in the route. Do
you have any ideas to do this?
*xml-file:*
/<data>
<record>
<account pan="12345"></account>
</record>
<record>
<account pan="67891"></account>
</record>
</data>/
*route xml:*
/ <split strategyRef="splitXmlAggregator"
stopOnException="true">
<tokenize token="record" xml="true" />
<setHeader headerName="Id">
<xpath
resultType="java.lang.String">/record/account@pan</xpath>
</setHeader>
</split>/
I use tokenizer to split based on xml file based on the token "record" into
2 splits. If i have a malformation inside the level of <record> tag the the
javax.xml.XPathExpressionException is thrown.
When i do have a malformation as below:
/<data>
<record>
<account pan="12345"></account>
</record>
record>
<account pan="67891"></account>
</record>
</data>/
Where the second record tag doesn't have a start '<' delimiter i.e on the
level of the <record> tag then the number of splits i get is only 1 not 2. I
wish to atleast log that i have skipped a record from being processed, a
count of the no. of records skipped. The second option is atleast i get to
log the skipped record, any suggestions for this?
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-split-tokenizer-does-not-identify-malformed-xml-tp5756111p5756638.html
Sent from the Camel - Users mailing list archive at Nabble.com.