Posted: Mon Nov 14, 2011 4:33 am Post subject: How to handle repeating complex types in CWF format
Novice
Joined: 24 May 2011 Posts: 18
Hi
I have a requirement of transforming an XML to CWF format where the structure of CWF format is
Message
Header ( comes only once)
... Elements (1-n)
Body ( repeating )
... Elements(1-n)
Trailer (comes only once)
... Elements(1-n)
my question is how to handle the repeating complex type (i.e. Body) as it pops out warning that I have an unbounded number of repeats for the element and this must be the last element of the parent element.
CWF does not allow tags, so the only *safe* place for something that repeats an *unknown* number of times is at the end of the message. That way, the end of the message marks the end of the last occurrence.
I assume that your data contains some type of 'record identifier' or 'tag' that the next application will use when it is parsing the data. If so, then it should be safe to ignore the warning.
You could nest the trailer record as an optional child of the body.
Then the body would be the end of the record, and would repeat an unlimited number of times, and only the last instance of the body would have an occurrence of the trailer.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum