By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,054 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,054 IT Pros & Developers. It's quick & easy.

Need to generate a text file.

P: n/a

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
Sep 29 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Look at XSLT for this

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

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


"Jens Jensen" wrote:
>
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
Sep 29 '06 #2

P: n/a
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
"Michael Nemtsev" <ne*****@msn.comskrev i en meddelelse
news:7F**********************************@microsof t.com...
Look at XSLT for this

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

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


Sep 29 '06 #3

P: n/a
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

jJI read somewhere :
jJ"
jJXSLT is used to transform an XML document into another XML document,
jJor
jJanother type of document that is recognized by a browser, like HTML
jJand
jJXHTML. Normally XSLT does this by transforming each XML element into
jJan
jJ(X)HTML element.
jJ"
jJ>
jJMy text file is not targeting any browser. Is XSLT still the best
jJway to go?
jJ>
jJThanks
jJ>
jJJJ
jJ>
jJ"Michael Nemtsev" <ne*****@msn.comskrev i en meddelelse
jJnews:7F**********************************@micros oft.com...
jJ>
>Look at XSLT for this

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do
not
cease to be insipid." (c) Friedrich Nietzsche
---
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
Sep 29 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.