<Root>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<success></success>
</Envelope>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<success></success>
</Envelope>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<criticalerror></criticalerror>
</Envelope>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<success></success>
</Envelope>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<criticalerror></criticalerror>
</Envelope>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<criticalerror></criticalerror>
</Envelope>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<milderror></milderror>
</Envelope>
<Envelope>
<Header>
<ineed>apple</ineed>
</Header>
<success></success>
</Envelope>
</Root>
Hi,
I am not sure how to get this working with xslt. The xml file has "Envelope" elements always in even number of occurences, the reason being, the xml will indicate us success, error or warning based on pairs(first and second, third and fourth etc). The top priority is for "criticalerror" element, that is, if this element is present in the pair, the pair is considered as error, the element can occur twice as well.
The next priority goes to "milderror" element which stands for warning. The third priority goes to "success" element. Therefore only if both contains "success" in the pair, considered as success.
For the above case first pair is success, second one is an error, third one is an error, fourth one is a warning. There are two errors, one success and one warning. This will produce an xml like below. Again, error is having higher priority(occurs first in xml), warning next
<Root>
<error></error>
<error></error>
<warning></warning>
<success></success>
</Root>
Now I have a for each action with the above xml, for each paired scenarios(success, error and warning), there are three for each actions(that is how my design is ), which is an action in datapower
Coming to my success for each action, I need to get the "ineed" element from the top xml, corresponding to the success pair, which is "apple", this can occur in either one or both, within a pair of top xml. It is same for a pair, however can occur in either one, or both.
All I have is the context loopcount variable(1 in this case), for success, which is going to iterate for all success scenario
Similary for error scenario(looping 2 times in this case), need to get the corresponding "ineed" element from top xml. Loopcount variable 1, next time loopcount variable is 2
Samething for warning scenario as well.