I am working with an incoming EDI file where I use lookaheads to identify the correct loop. In my case, the EDI file contains the Service Level Loop (HL/HL03='SS') appearing twice. While I can successfully extract the first occurrence using the following XPath:
xpath("HLLoop1[HL/HL03='SS']/MSG/MSG01")I attempted to retrieve the second occurrence using:
xpath("HLLoop1[HL/HL03='SS'][2]/MSG/MSG01")Although this expression did not return an error, it did not extract the expected data either.
Has anyone encountered a similar issue? What would be the correct XPath expression to extract both occurrences of the Service Level Loop? Any insights or alternative approaches would be greatly appreciated!



