How to generate HTML pages

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hi all,

I'm about to embark on a new project and can't decide quite how to do it.
In summary, I have a database whose data I want to use to create html pages
for a website. The website will just be a series of static html pages. I
will keep all the data locally and would generate the required pages and
upload them whenever I needed to. I do not want to have the database
anywhere but on my lcoal machine.

My questions are:
1. Should I create a windows or web application to generate my pages?
2. If a window app, will this be faster?
3. If an web app, how do I automatically save the result of an aspx page as
static html?
4. What would you recommend as the best way to generate these pages -
HTMLTextWriter?
5. Should I perhaps generate XML and use XSL to render the pages?
6. What classes are available (and best) for the generation of html pages?

Which direction would you all head in?
Thanks for any advice or ideas.
Nick
 
1. Should I create a windows or web application to generate my pages?

My vote would be for a windows app - you're not planning to host it on
a remote machine, you don't need to access it from your holidays on
Hawaii - so there's no point or real benefit in creating a web app,
really.
2. If a window app, will this be faster?

Most likely, yes. A lot more powerful and easier to use, too - the
Windows UI is just that much richer than the severly limited web /
HTML interface can ever be.
4. What would you recommend as the best way to generate these pages -
HTMLTextWriter?

Have a look at CodeSmith - it's a freeware code generation / template
tool which can be easily used from a .NET app. You could easily set up
your HTML pages as CodeSmith templates, and pull out the data from the
data to feed them into the CodeSmith templates.

http://www.ericjsmith.net/codesmith/
5. Should I perhaps generate XML and use XSL to render the pages?

I don't see much benefit in this, unless you already have XML to begin
with. Otherwise, you'll end up converting your native data format to
XML, then send it through XSL transformation, to end up in HTML - why
not create the HTML from the raw data in the first place? Also, XSL is
not always all that easy to learn and use, and some rather basic
operations (like grouping etc.) are just a royal pain in XSL (at least
in 1.0).
6. What classes are available (and best) for the generation of html pages?

CodeSmith - see above! ;-)

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
I would recommend to create XML from the data
and use XSLT to transform into HTML.
That way, you get a flexible solution.
IMO, HTML should never be "hard coded".
Layout is easily modified directly in the XSLT file, in case there is
something you need to change.

And besides, maybe you some day would need some other
format like text or another XML format like XSL-FO or SVG or whatever.
Then, you will only need to write a new XSLT template in a few minutes.

XSLT is very powerful.
 
Back
Top