RE: Is there a source document for every Web resource?

John asked for examples for web resources without source documents like HTML
has. 

Gregg: 

> There are some sites that do it from a database and generate 
> pages on the fly.  In that case there would be a source database.. 

John:	
	
> Source database, yes-- but don't the data then flow into 
> a template (or something) which the user agent then uses to render 
> what the user reads/interacts with?
	 
Yvette:

Hi John,
	 
For database-driven websites, what goed to the client is regular HTML. In
that sense, you can view the HTML source, but that's not what the author has
on his web server. 

The funky stuff all happens under the hood. It depends on the way the
programmer programs the server-side script. You can use aa HTML-like
template and use search-and-replace techniques to add the database-driven
content but there are a zilion other ways. That technique is used especially
for semi-static pages where a lot of the content is the same but some of the
content comes from the database. 
	 
For web content that is more dynamic, e.g. where the content of the page has
a different layout based on the database content, you usually write the
entire HTML from code with lots of conditional statements. Example in
pseudocode:
	 
	title = "Picture of a "
	 
	If animal = "dog" then
	    title = title + "dog"
	    stylesheetsrc = "doggy.css"
	end if
	 
	print "<title>" + title + "</title>"
	print "<head>" + "<link rel='stylesheet' src=" + stylesheetsrc + ">"
	 
Every programmer has his own style. Some prefer to use templates, some
prefer to write everything from code.
	 
Personally, I prefer getting the data from the database in XML format
(either directly or programmatically), and transform that XML to XHTML
server-side using an XSLT. This way I separate the data logic from the
presentation logic which saves a lot of time if the client decides on a
different layout. It has a certain 1.3 sound to it, doesn't it? :-)

What would I call the source document in this case? That depends on your
definition, I guess. I would call the scripts that communicate with the
database, the scripts that generate the XML, the XSLT and the scripts that
apply the XSLT "source". 

But that's a totally different kind of source than the source for an HTML,
since this source is interpreted by the webserver. What I do or don't do in
my source doesn't matter for accessibility, as long as the result (HTML in
my case) is accessible. 
	 
Yvette Hoitink
CEO Heritas, Enschede, the Netherlands
E-mail: y.p.hoitink@heritas.nl
	

Received on Wednesday, 25 February 2004 18:16:43 UTC