views:

69

answers:

2

I have a requirement to hand-code an text file from data residing in a SQL table. Just wondering if there are any best practices here. Should I write it as an XMLDocument first and transform using XSL or just use Streamwriter and skip transformation altogether? The generated text file will be in EDIFACT format, so layout is very specific.

A: 

The normal thing to do is just write the EDIFACT data directly.

Creating it as an XMLDocument and transforming it to EDIFACT might be useful if there's a library already available to do the transformation. I say this because there's a lot of language support for XML output.

I can't see how XSL will help you here, but I've never had to output EDIFACT data.

egrunin
A: 

http://www.stylusstudio.com/edi/XML_to_EDIFACT.html

This URL has an example XSLT for translating XML to EDIFACT which might solve your problem.

Phil Bennett