I am trying to parse XML document using pub.xml:xmlStringtoXMLNode and pub.xml:xmlNodeToDocument
I have created an IS schema from a DTD and created a corresponding Document Type in IS. According to the structure of the document I do have several document lists inside my “global document”.
To build the logic and navigate through my document, I make extensive use of the LOOP step to loop through my document lists.
While testing my code, I found out that some times some of my LOOP steps were not executed in some situations. And after looking carefully to the XML, I found out that the resulted IS document after parsing didn’t contain a document list when there is only one element in the list which caused the LOOP not being executed.
May be this is not very clear so here is an example:
Let say you have an Order with several line items, parsing will give you
where LineItem is a document list so that your LOOP works fine
now, if you have only one line item in your XML document and even if the associated IS document defines LineItem as a document list, you will get
Whiwh cause the LOOP not being executed, now if the parsing give something like
Even if there is only one element in your document list, the LOOP will be executed.
I don’t know if someone had faced that “problem” before. Is this by design? or a bug in the parser? Is there any fix or do I have to write code to handle the 1 line item case separately!!
For information, I am using IS 6.1 with Developer 6.1, is this a bug in version 6.1 or was it working fine with 6.0.1 and 4.6?