473,587 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

create html from flat file

Using a flat file containing table names, fields, values whats the
best way of creating html pages?

I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlinks ie the usual.

The data is not obtained directly from a database.

I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.

Maybe there could be existing html pages that could be used in the
generation of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.

Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
Jun 27 '08 #1
15 5257
lx****@googlema il.com wrote:
Using a flat file containing table names, fields, values whats the
best way of creating html pages?

I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlinks ie the usual.

The data is not obtained directly from a database.

I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.

Maybe there could be existing html pages that could be used in the
generation of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.

Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.

Much simpler (and server-friendly) than recreating the same page on
every request.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 27 '08 #2
On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy...@googlema il.com wrote:
Using a flat file containing table names, fields, values whats the
best way of creating html pages?
I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlinks ie the usual.
The data is not obtained directly from a database.
I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.
Maybe there could be existing html pages that could be used in the
generation of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.
Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.

If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.

Much simpler (and server-friendly) than recreating the same page on
every request.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Hi Jerry,

But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.

So the issues are :
1. flat file - what format should this be in - xml ?
2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.

But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.

I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
Jun 27 '08 #3
lxy one wrote:
On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>lxy...@googlem ail.com wrote:
>>Using a flat file containing table names, fields, values whats the
best way of creating html pages?
I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlinks ie the usual.
The data is not obtained directly from a database.
I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.
Maybe there could be existing html pages that could be used in the
generation of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.
Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.

Much simpler (and server-friendly) than recreating the same page on
every request.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attg lobal.net
============== ====

Hi Jerry,

But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.
OK, I understand better now.
So the issues are :
1. flat file - what format should this be in - xml ?
The simple answer is - whatever form suits you best. I've seen xml
files, csv files, php code and even just plain text. It all depends on
the data and what's easiest for you.

I would think that since your file needs to contain tables/fields and
data, xml might be easiest to parse and maintain. But that's probably
because I've worked with xml a fair amount. But if you haven't, another
form (such as csv) might be easier.
2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.
Well, you'll have to read the file then display all of the information
on a web page. Then select the information you wish to display.
Finally, generate the page.
But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.
You're now talking about a templating system, which is very popular.
The nice thing about it is it takes a lot of the "grunt work" out of the
code required to generate the page. It also separates the rest of the
page from the actual data being displayed, making it easier to maintain.
I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
I've used it before, when the data doesn't change very often. It can be
very effective on high usage sites. For lower usage sites and data
which changes fairly regularly, I just generate the pages dynamically on
request.

And I think you'll find most of the systems use a database instead of a
flat file. It makes things a lot easier - the database manages the data
for you, so you don't have to do as much in your code. Simple SQL
requests are not that hard to learn, and if you're going to be serious
about web development, they're pretty much a requirement nowadays. SQL
is just too powerful to ignore.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 27 '08 #4
On 6 Jun, 11:39, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy one wrote:
On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy...@googlema il.com wrote:
Using a flat file containing table names, fields, values whats the
best way of creating html pages?
I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlinks ie the usual.
The data is not obtained directly from a database.
I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.
Maybe there could be existing html pages that could be used in the
generation of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.
Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.
Much simpler (and server-friendly) than recreating the same page on
every request.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Hi Jerry,
But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.

OK, I understand better now.
So the issues are :
1. flat file - what format should this be in - xml ?

The simple answer is - whatever form suits you best. I've seen xml
files, csv files, php code and even just plain text. It all depends on
the data and what's easiest for you.

I would think that since your file needs to contain tables/fields and
data, xml might be easiest to parse and maintain. But that's probably
because I've worked with xml a fair amount. But if you haven't, another
form (such as csv) might be easier.
2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.

Well, you'll have to read the file then display all of the information
on a web page. Then select the information you wish to display.
Finally, generate the page.
But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.

You're now talking about a templating system, which is very popular.
The nice thing about it is it takes a lot of the "grunt work" out of the
code required to generate the page. It also separates the rest of the
page from the actual data being displayed, making it easier to maintain.
I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.

I've used it before, when the data doesn't change very often. It can be
very effective on high usage sites. For lower usage sites and data
which changes fairly regularly, I just generate the pages dynamically on
request.

And I think you'll find most of the systems use a database instead of a
flat file. It makes things a lot easier - the database manages the data
for you, so you don't have to do as much in your code. Simple SQL
requests are not that hard to learn, and if you're going to be serious
about web development, they're pretty much a requirement nowadays. SQL
is just too powerful to ignore.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Hi Jerry,

Can you point me code examples please as I'm new to this.

As to why a flat file instead of a DB - the idea for the flat file was
that it would combine both table data and form data to allow the
generation of each web page.
Jun 27 '08 #5
On 6/6/2008 7:48 AM, lxy one wrote:
On 6 Jun, 11:39, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>lxy one wrote:
>>On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy...@googl email.com wrote:
Using a flat file containing table names, fields, values whats the
best way of creating html pages?
I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlink s ie the usual.
The data is not obtained directly from a database.
I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.
Maybe there could be existing html pages that could be used in the
generatio n of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.
Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.
Much simpler (and server-friendly) than recreating the same page on
every request.
--
============ ======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@at tglobal.net
============ ======
Hi Jerry,
But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.
OK, I understand better now.
>>So the issues are :
1. flat file - what format should this be in - xml ?
The simple answer is - whatever form suits you best. I've seen xml
files, csv files, php code and even just plain text. It all depends on
the data and what's easiest for you.

I would think that since your file needs to contain tables/fields and
data, xml might be easiest to parse and maintain. But that's probably
because I've worked with xml a fair amount. But if you haven't, another
form (such as csv) might be easier.
>>2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.
Well, you'll have to read the file then display all of the information
on a web page. Then select the information you wish to display.
Finally, generate the page.
>>But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.
You're now talking about a templating system, which is very popular.
The nice thing about it is it takes a lot of the "grunt work" out of the
code required to generate the page. It also separates the rest of the
page from the actual data being displayed, making it easier to maintain.
>>I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
I've used it before, when the data doesn't change very often. It can be
very effective on high usage sites. For lower usage sites and data
which changes fairly regularly, I just generate the pages dynamically on
request.

And I think you'll find most of the systems use a database instead of a
flat file. It makes things a lot easier - the database manages the data
for you, so you don't have to do as much in your code. Simple SQL
requests are not that hard to learn, and if you're going to be serious
about web development, they're pretty much a requirement nowadays. SQL
is just too powerful to ignore.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attg lobal.net
============== ====

Hi Jerry,

Can you point me code examples please as I'm new to this.

As to why a flat file instead of a DB - the idea for the flat file was
that it would combine both table data and form data to allow the
generation of each web page.
I do something similar with MS Access. I have a database with thousands
of records that changes often and I want to create a new static html
page weekly with the updated data. I keep all of the pertinent
information in the database and make changes to it as necessary, then I
create a report from the database which generates the html page. I put
all of the static information as html in the header and the footer, and
all of the changing information goes between as database fields
surrounded by html tags. I use filter criteria in the report to keep
the unwanted information from appearing. You should be able to do
something similar with any database with reporting functions.

Dave Pyles
Jun 27 '08 #6
lxy one wrote:
On 6 Jun, 11:39, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>lxy one wrote:
>>On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy...@googl email.com wrote:
Using a flat file containing table names, fields, values whats the
best way of creating html pages?
I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlink s ie the usual.
The data is not obtained directly from a database.
I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.
Maybe there could be existing html pages that could be used in the
generatio n of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.
Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.
Much simpler (and server-friendly) than recreating the same page on
every request.
--
============ ======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@at tglobal.net
============ ======
Hi Jerry,
But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.
OK, I understand better now.
>>So the issues are :
1. flat file - what format should this be in - xml ?
The simple answer is - whatever form suits you best. I've seen xml
files, csv files, php code and even just plain text. It all depends on
the data and what's easiest for you.

I would think that since your file needs to contain tables/fields and
data, xml might be easiest to parse and maintain. But that's probably
because I've worked with xml a fair amount. But if you haven't, another
form (such as csv) might be easier.
>>2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.
Well, you'll have to read the file then display all of the information
on a web page. Then select the information you wish to display.
Finally, generate the page.
>>But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.
You're now talking about a templating system, which is very popular.
The nice thing about it is it takes a lot of the "grunt work" out of the
code required to generate the page. It also separates the rest of the
page from the actual data being displayed, making it easier to maintain.
>>I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
I've used it before, when the data doesn't change very often. It can be
very effective on high usage sites. For lower usage sites and data
which changes fairly regularly, I just generate the pages dynamically on
request.

And I think you'll find most of the systems use a database instead of a
flat file. It makes things a lot easier - the database manages the data
for you, so you don't have to do as much in your code. Simple SQL
requests are not that hard to learn, and if you're going to be serious
about web development, they're pretty much a requirement nowadays. SQL
is just too powerful to ignore.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attg lobal.net
============== ====

Hi Jerry,

Can you point me code examples please as I'm new to this.

As to why a flat file instead of a DB - the idea for the flat file was
that it would combine both table data and form data to allow the
generation of each web page.
Unfortunately, that's very difficult. Every system I've done like this
has been a custom system - with widely varying differences in amount of
code and difficulty. Every database has been different, also.

My suggestion would be to use google to find some simple templating
systems and see how they do it. There are a bunch out there.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 27 '08 #7
On 6 Jun, 18:06, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy one wrote:
On 6 Jun, 11:39, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy one wrote:
On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy...@google mail.com wrote:
Using a flat file containing table names, fields, values whats the
best way of creating html pages?
I want control over the html pages ie
1. layout
2. what data to show
3. what controls to show - text boxes, input boxes, buttons,
hyperlinks ie the usual.
The data is not obtained directly from a database.
I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.
Maybe there could be existing html pages that could be used in the
generation of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.
Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.
Much simpler (and server-friendly) than recreating the same page on
every request.
--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@att global.net
============= =====
Hi Jerry,
But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.
OK, I understand better now.
>So the issues are :
1. flat file - what format should this be in - xml ?
The simple answer is - whatever form suits you best. I've seen xml
files, csv files, php code and even just plain text. It all depends on
the data and what's easiest for you.
I would think that since your file needs to contain tables/fields and
data, xml might be easiest to parse and maintain. But that's probably
because I've worked with xml a fair amount. But if you haven't, another
form (such as csv) might be easier.
>2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.
Well, you'll have to read the file then display all of the information
on a web page. Then select the information you wish to display.
Finally, generate the page.
>But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.
You're now talking about a templating system, which is very popular.
The nice thing about it is it takes a lot of the "grunt work" out of the
code required to generate the page. It also separates the rest of the
page from the actual data being displayed, making it easier to maintain.
>I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
I've used it before, when the data doesn't change very often. It can be
very effective on high usage sites. For lower usage sites and data
which changes fairly regularly, I just generate the pages dynamically on
request.
And I think you'll find most of the systems use a database instead of a
flat file. It makes things a lot easier - the database manages the data
for you, so you don't have to do as much in your code. Simple SQL
requests are not that hard to learn, and if you're going to be serious
about web development, they're pretty much a requirement nowadays. SQL
is just too powerful to ignore.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Hi Jerry,
Can you point me code examples please as I'm new to this.
As to why a flat file instead of a DB - the idea for the flat file was
that it would combine both table data and form data to allow the
generation of each web page.

Unfortunately, that's very difficult. Every system I've done like this
has been a custom system - with widely varying differences in amount of
code and difficulty. Every database has been different, also.

My suggestion would be to use google to find some simple templating
systems and see how they do it. There are a bunch out there.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Jerry, David,

I think I've not been clear on what I'm after and I guess that's
because I'm still pondering the problem.

1. Although tables/fields may vary, the creation of the static web
pages would be a one off ie once up and running no changes would be
expected. The reason for working this way, generating web pages, is to
cater for having different tables/fields and web page specifications.
So instead of having sets of static web pages to create/maintain you
can just create a new set by modifying a flat file. I cannot help
thinking that this must have been done.
2. Also misleadingly in a subsequently post I made a boo-boo in
indicating data values would be included in the flat file - not true,
the form would request this.
3. I thought the tricky bit would be creating the flat file ie
retrieving DB tables/fields and combining these with web page
specifications (optional/mandatory fields, controls, images etc). This
really is the crux. You would have to know what tables/fields to
expect. If a web page has a mandatory field specified and the field is
not one of those retrieved from the DB then maybe that's an abort.
Whereas if it's optional then we can go ahead and create the flat
file.

As for 1. above I will search on : simple templating systems. Thanks.
Jun 27 '08 #8
lxy one wrote:
On 6 Jun, 18:06, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>lxy one wrote:
>>On 6 Jun, 11:39, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy one wrote:
On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>lxy...@goo glemail.com wrote:
>>Using a flat file containing table names, fields, values whats the
>>best way of creating html pages?
>>I want control over the html pages ie
>>1. layout
>>2. what data to show
>>3. what controls to show - text boxes, input boxes, buttons,
>>hyperlink s ie the usual.
>>The data is not obtained directly from a database.
>>I was thinking maybe the flat file could use xml. And maybe this flat
>>file could be generated using :
>>1. the database data and
>>2. a template file to indicate the controls that should appear on each
>>html page.
>>Maybe there could be existing html pages that could be used in the
>>generatio n of the required final html pages ie maybe they could
>>contain static data - such as layout, headings and tags as to where
>>fields, controls need to be placed.
>>Searchi ng on this is difficult as the key words are too common :
>>create, html, xml, dynamic, template etc results in million+ hits.
>If you're going to go to all that trouble, why not just create the html
>page from the flat file and store it as a static page? Then when the
>flat file changes, regenerate the html.
>Much simpler (and server-friendly) than recreating the same page on
>every request.
>--
>========== ========
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>jstuck...@ attglobal.net
>========== ========
Hi Jerry,
But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.
OK, I understand better now.
So the issues are :
1. flat file - what format should this be in - xml ?
The simple answer is - whatever form suits you best. I've seen xml
files, csv files, php code and even just plain text. It all depends on
the data and what's easiest for you.
I would think that since your file needs to contain tables/fields and
data, xml might be easiest to parse and maintain. But that's probably
because I've worked with xml a fair amount. But if you haven't, another
form (such as csv) might be easier.
2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.
Well, you'll have to read the file then display all of the information
on a web page. Then select the information you wish to display.
Finally, generate the page.
But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.
You're now talking about a templating system, which is very popular.
The nice thing about it is it takes a lot of the "grunt work" out of the
code required to generate the page. It also separates the rest of the
page from the actual data being displayed, making it easier to maintain.
I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
I've used it before, when the data doesn't change very often. It can be
very effective on high usage sites. For lower usage sites and data
which changes fairly regularly, I just generate the pages dynamically on
request.
And I think you'll find most of the systems use a database instead of a
flat file. It makes things a lot easier - the database manages the data
for you, so you don't have to do as much in your code. Simple SQL
requests are not that hard to learn, and if you're going to be serious
about web development, they're pretty much a requirement nowadays. SQL
is just too powerful to ignore.
--
============ ======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@at tglobal.net
============ ======
Hi Jerry,
Can you point me code examples please as I'm new to this.
As to why a flat file instead of a DB - the idea for the flat file was
that it would combine both table data and form data to allow the
generation of each web page.
Unfortunatel y, that's very difficult. Every system I've done like this
has been a custom system - with widely varying differences in amount of
code and difficulty. Every database has been different, also.

My suggestion would be to use google to find some simple templating
systems and see how they do it. There are a bunch out there.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attg lobal.net
============== ====

Jerry, David,

I think I've not been clear on what I'm after and I guess that's
because I'm still pondering the problem.

1. Although tables/fields may vary, the creation of the static web
pages would be a one off ie once up and running no changes would be
expected. The reason for working this way, generating web pages, is to
cater for having different tables/fields and web page specifications.
So instead of having sets of static web pages to create/maintain you
can just create a new set by modifying a flat file. I cannot help
thinking that this must have been done.
This really can't be done. You can create templates for common stuff
like headers and footers. But the main content of each page is
typically different and requires different HTML. Otherwise every page
on the web would look the same.

As I said before - there are a bunch of templating systems out there -
but even with the best, you still need to create the content for each page.

For instance - your home page should describe your company/organization,
what you do, etc. It probably won't have any tables in it. But a page
from your catalog will have to list one or more products and will look
different. And a page comparing similar products will look different yet.
2. Also misleadingly in a subsequently post I made a boo-boo in
indicating data values would be included in the flat file - not true,
the form would request this.
OK, so you're talking about a template based on text files. But the
same rules above apply.

3. I thought the tricky bit would be creating the flat file ie
retrieving DB tables/fields and combining these with web page
specifications (optional/mandatory fields, controls, images etc). This
really is the crux. You would have to know what tables/fields to
expect. If a web page has a mandatory field specified and the field is
not one of those retrieved from the DB then maybe that's an abort.
Whereas if it's optional then we can go ahead and create the flat
file.
Yes, and that will be different for each page. Additionally, how you
display that data will often be different for each page, as noted above.
As for 1. above I will search on : simple templating systems. Thanks.
There are ways to make things easier. But there is no way to make
everything the same, unless all of the pages look the same.

You could create a templating system where you have an admin page and
fill in the blanks with the database information. But it still really
restricts you on how that data is going to be displayed. The other
option would be to store the HTML in the database also - but that means
your data is only good for the website itself. If later you wanted to
do something like create an RSS feed of your catalog, the data in the
database would be virtually worthless unless you did some really
complicated cleaning of it.

I'm not saying it's not a good idea. But not all good ideas can be
translated into workable ones.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jun 27 '08 #9
On 6 Jun, 22:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy one wrote:
On 6 Jun, 18:06, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy one wrote:
On 6 Jun, 11:39, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy one wrote:
On 6 Jun, 03:30, Jerry Stuckle <jstuck...@attg lobal.netwrote:
lxy...@goog lemail.com wrote:
>Using a flat file containing table names, fields, values whats the
>best way of creating html pages?
>I want control over the html pages ie
>1. layout
>2. what data to show
>3. what controls to show - text boxes, input boxes, buttons,
>hyperlin ks ie the usual.
>The data is not obtained directly from a database.
>I was thinking maybe the flat file could use xml. And maybe this flat
>file could be generated using :
>1. the database data and
>2. a template file to indicate the controls that should appear on each
>html page.
>Maybe there could be existing html pages that could be used in the
>generati on of the required final html pages ie maybe they could
>contain static data - such as layout, headings and tags as to where
>fields, controls need to be placed.
>Searchin g on this is difficult as the key words are too common :
>create, html, xml, dynamic, template etc results in million+ hits.
If you're going to go to all that trouble, why not just create the html
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.
Much simpler (and server-friendly) than recreating the same page on
every request.
--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@a ttglobal.net
=========== =======
Hi Jerry,
But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.
OK, I understand better now.
So the issues are :
1. flat file - what format should this be in - xml ?
The simple answer is - whatever form suits you best. I've seen xml
files, csv files, php code and even just plain text. It all depends on
the data and what's easiest for you.
I would think that since your file needs to contain tables/fields and
data, xml might be easiest to parse and maintain. But that's probably
because I've worked with xml a fair amount. But if you haven't, another
form (such as csv) might be easier.
2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.
Well, you'll have to read the file then display all of the information
on a web page. Then select the information you wish to display.
Finally, generate the page.
But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.
You're now talking about a templating system, which is very popular.
The nice thing about it is it takes a lot of the "grunt work" out of the
code required to generate the page. It also separates the rest of the
page from the actual data being displayed, making it easier to maintain.
I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
I've used it before, when the data doesn't change very often. It can be
very effective on high usage sites. For lower usage sites and data
which changes fairly regularly, I just generate the pages dynamically on
request.
And I think you'll find most of the systems use a database instead of a
flat file. It makes things a lot easier - the database manages the data
for you, so you don't have to do as much in your code. Simple SQL
requests are not that hard to learn, and if you're going to be serious
about web development, they're pretty much a requirement nowadays. SQL
is just too powerful to ignore.
--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@att global.net
============= =====
Hi Jerry,
Can you point me code examples please as I'm new to this.
As to why a flat file instead of a DB - the idea for the flat file was
that it would combine both table data and form data to allow the
generation of each web page.
Unfortunately, that's very difficult. Every system I've done like this
has been a custom system - with widely varying differences in amount of
code and difficulty. Every database has been different, also.
My suggestion would be to use google to find some simple templating
systems and see how they do it. There are a bunch out there.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
Jerry, David,
I think I've not been clear on what I'm after and I guess that's
because I'm still pondering the problem.
1. Although tables/fields may vary, the creation of the static web
pages would be a one off ie once up and running no changes would be
expected. The reason for working this way, generating web pages, is to
cater for having different tables/fields and web page specifications.
So instead of having sets of static web pages to create/maintain you
can just create a new set by modifying a flat file. I cannot help
thinking that this must have been done.

This really can't be done. You can create templates for common stuff
like headers and footers. But the main content of each page is
typically different and requires different HTML. Otherwise every page
on the web would look the same.

As I said before - there are a bunch of templating systems out there -
but even with the best, you still need to create the content for each page.

For instance - your home page should describe your company/organization,
what you do, etc. It probably won't have any tables in it. But a page
from your catalog will have to list one or more products and will look
different. And a page comparing similar products will look different yet.
2. Also misleadingly in a subsequently post I made a boo-boo in
indicating data values would be included in the flat file - not true,
the form would request this.

OK, so you're talking about a template based on text files. But the
same rules above apply.
3. I thought the tricky bit would be creating the flat file ie
retrieving DB tables/fields and combining these with web page
specifications (optional/mandatory fields, controls, images etc). This
really is the crux. You would have to know what tables/fields to
expect. If a web page has a mandatory field specified and the field is
not one of those retrieved from the DB then maybe that's an abort.
Whereas if it's optional then we can go ahead and create the flat
file.

Yes, and that will be different for each page. Additionally, how you
display that data will often be different for each page, as noted above.
As for 1. above I will search on : simple templating systems. Thanks.

There are ways to make things easier. But there is no way to make
everything the same, unless all of the pages look the same.

You could create a templating system where you have an admin page and
fill in the blanks with the database information. But it still really
restricts you on how that data is going to be displayed. The other
option would be to store the HTML in the database also - but that means
your data is only good for the website itself. If later you wanted to
do something like create an RSS feed of your catalog, the data in the
database would be virtually worthless unless you did some really
complicated cleaning of it.

I'm not saying it's not a good idea. But not all good ideas can be
translated into workable ones.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attgl obal.net
=============== ===
I understand what you are saying here :
This really can't be done. You can create templates for common stuff
like headers and footers. But the main content of each page is
typically different and requires different HTML. Otherwise every page
on the web would look the same.
but why can't you specify content? For the look and layout a dynamic
web template could be used and for page content the flat file could
have something like :
---------------
web page 1
<content>
input box + properties eg page centered
submit button + properties
web page 2
<content>
table + properties
field1 and so on
---------------
Jun 27 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9774
by: Yellowbird | last post by:
I have an HTML form with a pre-built table containing "standard" column headings (for example, First Name, Last Name, SSN, Hours, etc.). I want a user to be able to enter values into the form and then submit it. The data will be emailed to an administrator who will then print the month's report. I also plan to extract the data and store it in...
13
3406
by: raykyoto | last post by:
Hi all, I'm sure this is a popular question that comes up every few months here. Indeed, I've looked at some of the past postings, but I would like to ask things differently. Basically, I'm using a flat file to storing data. I have to do this because mySQL is not installed on my web server, and I am not the root user. The amount of...
2
3914
by: kk | last post by:
Hello, Help! Does anyone have an example of a trigger that will export a newly inserted row into a flat file? Basically anytime a row is inserted into a specific table a flatfile (fixed width) should be created in a hardcoded directory. I have the export command created but it doesn't seem to work in a trigger. I am sort of a newb to DB2...
22
2997
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text files, which in turn could be simply and easily maintained with notepad. I understand the benefits of XML, really, but in the case of configuration...
1
1953
by: news.microsoft.com | last post by:
Hello and first of all thank you for your time. I am currently developing an ASP.net web page, which has data stored in SQL Server. It is a web page for a State Agent and my problem is: I need to create an image gallery (with some kind of slide Next and Previous picture) of the flat you are interested to see. The pictures are stored on...
2
51977
by: sangu_rao | last post by:
Hi, I have to prepare an ER diagram for the objects in my SQL Server database. I have used the option "DIAGRAMS" in EnterPrise Manager of SQL Server 2000. It is creating the diagram for the selected tables (but the diagram contains only the table which i have selected. It is not displaying its depended tables). But i am not able to export it...
9
2183
by: FFMG | last post by:
In my site I have a config table, (MySQL), with about 30 entries; the data is loaded on every single page load. This is not the only call to the db, (we do a total of about 8 calls to the db). As with many configurations settings, once the options are set the values will not change much. So I thought it would be a good idea to move the data...
2
6122
by: murthydb2 | last post by:
Hi My requirement is that i have to write a stored procedure in db2 and that will be executed in a batch file . Any system error or validation error that occurs inside the db2 sp during the execution need to be written in external flat file ( Log file to know the error ) . Is there anything similar in db2 like UTL_FILE in oracle...
0
1707
by: raka61 | last post by:
Hi , I need help in understanding if i can directly(there are 100s of different structured files i get in text format with & hence dont wnat to manually define the structure for each file manually) create a db2 table with the structure & data as in excel or flat file by importing the flat file .I have only DB@ enterprise server.No other...
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.