Read XML files using Developer and compare them.


I’m trying to compare two XML files(line to line), in Developer.
So far this what I’ve tried.

  • Get the file using pub.file:getFile
  • Convert xmlString to XMLNode.
  • Convert xmlNode to Document.

so I have two documents file1 and file2

I need to compare this document from Node to Node. How will I be able to achieve this? Am I using the right approach? I’m stuck at this step. I need some help here.

many Thanks!

If you want to compare two documents after the step xmLNodeToDocument , You can write a java service to compare them

IData file1= IDataUtil.getIData( pipelineCursor, “file1” );
IData file2= IDataUtil.getIData( pipelineCursor, “file2” );