In the following example the source meter creates xml files that contain the data. The files created to not conform to the <XML> specifications
The section surrounded by a red rectangle should be part of the header, not attributes for the root node node. The easiest approach would be to request the meters to be properly configured, so it would send well-formed files. Unfortunately, this is not always possible and if this is the case, then you need to clean the files before processing it.
In the above example, EDC would extract extract the data from the input file using a XML delimited file extract task, Because the input file is ill formed, it failed. To solve the problem a [Pre-process]>[Powershell Script processor task was added. The task calls the attached powershell script. The purpose of the script is:
- Replaces the node <data......> by <data>
- Moves the unedited file to a EndFolder
- Saves the edited file in the original folder and using the original name
The edited file is processed by the XML Extract task with no trouble, so EDC can continue keeping the data flow between meter and end system!
You can adapt the script to your specific needs. As mentioned before you may have an incorrectly rendered foreign character, or garbage bits introduced at random, or as in the above case, and ill-configured system. Hopefully in all these case you will find this posting useful!.