Forum OpenACS Development: Re: Moving to XHTML

Collapse
7: Re: Moving to XHTML (response to 6)
Posted by Tom Jackson on
Okay, so you are not going to be serving it as application/xhtml+xml, but as plain ol' text/html.

But I did notice that the static home page at w3.org is treated by Firefox as application/xhtml+xml even though a meta tag and the server headers indicate text/html.

I guess there isn't going to be an option of which to use in OpenACS, the home page here is already not HTML 4.01 transitional, using /> to close empty tags.

Collapse
9: Re: Moving to XHTML (response to 7)
Posted by Gustaf Neumann on
it looks to me as for http://www.w3.org/ the apache at w3c evaluates the "accept" request header field from the user agent; if it contains application/xhtml+xml, it serves the page (xhtml 1.0) with this type (no meta flag with http-equiv). If i open this page with safari, i get the meta tag http-equiv for the content type with text/html. We should be able to do similar depending on the capabilities of the browser.

if we simply want to stick with simply rendering traditional web-pages, there is no big need for moving towards XHTML (although it will make styling simpler). But look at the developments like microformats http://microformats.org/, or GRDDL http://www.w3.org/TR/2007/REC-grddl-20070911/, check out the use cases http://www.w3.org/TR/grddl-scenarios/ that show how to extract semantic information (RDF) from xhtml web pages. This opens many new perspectives, especially for systems built around a rich datamodel such as openacs.

-gustaf
PS: by "templating" i was refering in my earlier posting to the automatically generated html.

Collapse
10: Re: Moving to XHTML (response to 9)
Posted by Tom Jackson on
My version of Mozilla Firefox gets the w3 home page with a meta tag 'http-equiv="Content-Type" content="text/html; charset=utf-8"'. It is hard to see, smashed up against the head tag. However, I think you must be correct: the page it is being sent as application/xhtml+xml, when I use wget, it is text/html. Moving the identical file to my server and sending it, Firefox detects it as text/html, the only difference must be the server headers.

So how to solve the problem of being able to serve both. Simply making an additional template for each page wouldn't work. Some markup is produced in the tcl pages, in procs, and some is in the data. Somehow all these sources which make up the page which gets sent to the user have to be in sync.

My own method is to try to separate data, code and templating, roughly model-view-controller, but markup is difficult to handle generally. One idea is to have a data model which resembles RDF and to be able to apply templating to tiny chunks of code to create markup. As long as the two remain separate and allow for switching out the template, many different opportunities for reuse will open up. The RDF type model would allow the possibility of browsing the elements which were used to create a web page. (A simple html browser, or something using more complex, but either could operate on such a page just by using a different template. That is, the editor/browser would use the same technology on an expanded scale.) The RDF type linking between objects provides the semantic hints needed to pull this off.