Forum - XML Standard

 View Only

Best practice for running Edits on XML files

  • 1.  Best practice for running Edits on XML files

    Posted 05-06-2021 02:50 PM
    Stefan Winden

    Is there a recommended approach for programatically (batch process) running Edits on a NAACCR XML file, using Java? My thought is to use the IMS Java Library to convert the XML to flat buffer and then use the EDITS50.dll API for editing. Or is it preferable to use the XMLPlus DLL?

    Kathleen Beaumont

    Hi Stefan,

    Use whatever XML parser you like best. I needed something like XMLPlus.dll for my own work, and NPCR agreed to share it with anybody who wants to use it.

    If you decide to use an XML parser you already like in your Java work, do be sure that you understand all the requirements in the official NAACCR XML Implementation Guide. (That advice applies regardless of the parser you choose.)

    Converting the XML data file to a flat-format file is not necessary to run edits. The EDITS50.dll API includes functions and code samples showing how to build the flat-format buffer on the fly so that another disk file doesn't have to be created (and eventually deleted). On the other hand, if you have other uses for the flat-format data, then converting to flat once makes sense.

    Building the data buffer dynamically also gives you more flexibility when data needs to be edited in more than one record layout format. (If I recall correctly, New York uses one or more custom layouts.) The XMLExchange Plus help file has a discussion about the advantages of creating an edit buffer dynamically, plus sample code (annotated C++) showing how to run edits on XML files.

    Please note that XMLPlus.dll was published with the NAACCR XML Implementation Guide was at v1.2. However, I have reviewed the change notices in the current version, and to the best of my knowledge, XMLPlus.dll conforms with the current Implementation Guide (v1.4).

    Kathleen (still retired, but clearly still interested)