Avatar of MehtaJasmin
Flag for United States of America

asked on 

Which XML parser should I used for my requirement

I have a requirement

1) To decrypt the PGP encrypted XML file in memory,
2) and search for all the occurrences of  'card_number' element
3) encrypt them using other encryption API and replace the clear text value of 'card_number' element value
4) There after encrypt the whole XML file
5) and finally store that xml file on disk

During each execution of my Java program, I may have about 1 to 4 XML files to be processed for above requirement. Each file can have about 600 to 1000 'card_number' elements. Each decrypted file (if stored on disk can be  100 to 200 KB). But I will not have to let store on disk, keep in memory and process.

I have been looking into couple options:

1)  JDOM parser
2) DOM4J
3) or don't use any external jars/libraries but use core JDK API  like

I have been reading different options at http://www.tutorialspoint.com/java_xml/java_dom4j_parser.htm, and not able to decide which parser is suitable for my requirement.

Avatar of undefined
Last Comment

8/22/2022 - Mon