Need to generate a text file.

  • Thread starter Thread starter Jens Jensen
  • Start date Start date
J

Jens Jensen

Hello,
I need to generate a flat text file where aeach is made up os fields and
space.

To automate the process, i want to define an xml file that describe the file
form mate in term of
<Lines>

<Line1>

<Field fieldlengh="" value=""></Field>

<Field fieldlengh="" value=""></Field>

<Field fieldlengh="" value=""></Field>

<Field fieldlengh="" value=""></Field>

..

..

..

..



</Line1>

<Line2>

<Field fieldlengh="" value=""></Field>

<Field fieldlengh="" value=""></Field>

<Field fieldlengh="" value=""></Field>

<Field fieldlengh="" value=""></Field>

..

..

..

..



</Line2>



</Lines>

This can always be done but i'am looking for best practices/good design
pattern in C#

Has anyone don anything similar?

Any comment will be highly appreciated.

JJ
 
I read somewhere :
"
XSLT is used to transform an XML document into another XML document, or
another type of document that is recognized by a browser, like HTML and
XHTML. Normally XSLT does this by transforming each XML element into an
(X)HTML element.

"

My text file is not targeting any browser. Is XSLT still the best way to go?



Thanks

JJ
 
Hello jens,

If you have some template and need to fill it it's easy to use XSLT, but
it's only one approach
The second approach is to load your xml file and insert necessary info into
your nodes

jJ> I read somewhere :
jJ> "
jJ> XSLT is used to transform an XML document into another XML document,
jJ> or
jJ> another type of document that is recognized by a browser, like HTML
jJ> and
jJ> XHTML. Normally XSLT does this by transforming each XML element into
jJ> an
jJ> (X)HTML element.
jJ> "
jJ>
jJ> My text file is not targeting any browser. Is XSLT still the best
jJ> way to go?
jJ>
jJ> Thanks
jJ>
jJ> JJ
jJ>
jJ> "Michael Nemtsev" <[email protected]> skrev i en meddelelse
jJ> jJ>---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top