Hi all,
I have an XML file that I pick up with a File Pick Up Service that contains multiple blocks of XML. I would like to split into multiple messages but have not been successful so far. Has anyone successfully used a file splitter on XML?
Example:
<Data>
<Items>
<Item type="1">
<A></A>
<B></B>
<C></C>
</Item>
<Item type="2">
<A></A>
<B></B>
<C></C>
</Item>
</Items>
</Data>
I want to split the <Item> blocks into separate messages. I can't use the tags <Item> and </Item> for obvious reasons.
This causes an exception to occur in the service.
<splitter id="REGEXP_PATTERN_SPLITTER">
<regexpPatternSplitter fullLinePatterns="true">
<recordPattern recType="Data">
<start inclusive="true">.Item</start>
<end>/Item.</end>
</recordPattern>
</regexpPatternSplitter>
</splitter>
<splitter id="REGEXP_PATTERN_SPLITTER">
<regexpPatternSplitter fullLinePatterns="true">
<recordPattern recType="Data">
<start inclusive="false"><Item</start>
<end>/Item></end>
</recordPattern>
</regexpPatternSplitter>
</splitter>
Exception:
<?xml version="1.0" encoding="UTF-8"?>
<fileServicesEvent>
<eventType>FileFailedToPickup</eventType>
<timestamp>2010.01.06_10.35.01.553.-0600</timestamp>
<message>Pickup operation failed on file: C:\ESBSamples\FilePickup\TwoFiles.xml, File may be corrupt. Will attempt to rename to C:\ESBSamples\FilePickup\TwoFiles.xml_2010.01.06_10.35.01.553.-0600.fail
Exception Message:null</message>
</fileServicesEvent>