1
Vote

TransformToX12.exe preserves XML whitespace between nodes

description

I am really happy to have found this project and am very grateful for the work put in to it.

One thing I noticed is that whitespace between XML nodes is preserved when using TransformToX12. I believe this is a problem for trading partners that are using CR/LF as the segment terminator as any XML formatted to be human-readable will have many CR/LFs.

One simple solution is to modify OopFactory.X12.TransformToX12.Program.cs to allow a 3rd command line argument that would affect whether or not whitespace should be preserved during transformation.

I have attached modifications to the Program.cs file mentioned above. Apologies if there is a way to contribute that I have missed here or if I'm missing something else that addresses this issue.

Edit: I have updated the attachment

file attachments

comments

gftrader wrote Sep 5, 2016 at 3:28 PM

The original solution I provided relied on Regex to string whitespace, but this also removed whitespace when nodes had only whitespace in them. The new fix relies on XmlDocument's "preserve whitespace" property and loads the file using the same filestream that it otherwise used.

wrote Sep 5, 2016 at 3:28 PM