Dave, Which unit test file(s) for XMLReader are you seeing that the output is JSON? I ran TestXMLReader and TestXMLRecordReader and didn't see any console output. Most unit tests for Readers only test that the internal Record objects have been parsed correctly, they don't usually go an extra step and pass them through a Writer, since that's not the unit-under-test.
For stripped-down examples of Reader/Writer implementations, take a look at the unit tests for ScriptedReader and ScriptedRecordSet writer, they use simple scripts that have the bare-bones config needed to implement a Reader/Writer, such as implementing a RecordReaderFactory, using its method(s) to create RecordReader(s), and using the Reader to iterate over records as they are parsed. An important point is to avoid (at all costs!) reading the entire input into memory and then parsing/iterating. The Readers/Writers are designed specifically to only parse/write one record at a time, so memory usage does not become an issue and thus very large files can be read/written. Regards, Matt On Tue, Apr 21, 2020 at 9:02 AM DAVID SMITH <[email protected]> wrote: > > Hi > I want to use the ConvertRecord Processor with it's underlying Record Readers > and Writers to convert files from XML or JSON to a bespoke format and > probably vice versa.I have looked at the Readers/Writers currently provided > and decided that I can use the XML/JSON ones provided but I will need to > write something for the bespoke format. So I started looking at the current > source code for the Readers/Writers to see how they work and what I would > need to do. When running the unit tests on the XMLReader I notice on the > console that the output is in JSON format.My question is, is JSON the common > format that all records are converted to and from? > Also is there any specific documentation on writing Reader/Writers, I have > only found the developers guide? > Many thanksDave >
