Here is the problem. The Sequence step with #4.1 will be executed only in Case#2, but not in Case#1, because of the difference in strucutres. My complete logic will be in & after this sequence step. The same problem occurs for all the consecutive repeating Child elements.
How can I loop on the parent node without caring for the occurences?. Is there any wrong in my approach or is there any other way around?
try invoking IO.idata.readAndWriteDocumentList in the WmSamples package.
Pass in your “Parent” to the service in.
What it’s supposed to do is if there is only one occurrence of Parent it will still force it to be a list. Therefore you only have to code for list situations.
Or you can create a document of structure for input XML, then set the parent as document list. In the parsing service, choose the document as your schema.
But did not solve my problem though. When I used “IO.idata.readAndWriteDocumentList” and sent Parent as the input, all the document $ DocumentLists that are within/under the Parent are converted to Strings. Hence I cannot go ahead with further mapping since I also have to map all the data that follows down under.
What I need to know is the reason for variance in result structures based on the occurence of the DocumentList fields as specified in Case#1 and Case#2 and how to proceed further with the mapping by looping on the DocumentList fields.
When the pub.xml:XMLDocumentToNode executes in the case where only one “parent” exists does the resulting record structure show the parent node as a document or document list?
If it is not a document, try one or both of the following:
In the arrays input parameter type the name of the “parent” record to force this service to create the parent node as a document list. [*]In the documentTypeName input parameter specify the fully qualified (folder.subfolder:docTypeName) of the documentType structure that you want to impose on the resulting document.
These input parameters are explained in the IS Built-In Services Guide found in your <developerroot>\doc folder.
To answer your question. If there is only one Parent the resulting Structure is Document, but if there are multiple parents the result is a DocumentList of Parents.
I used your 2nd condition, the result structure pops up as a DocumentList regardless of the occurences. This is what I actually need to loop further on DocumentList