Forum OpenACS Development: Re: Moving to XHTML

Collapse
11: Re: Moving to XHTML (response to 1)
Posted by Torben Brosten on
Are there other (practical) ways to optionally output html or xml (including mime-types) besides completely rewriting acs-templating (or depending on xotcl-core)?

Briefly looking at the source code of these procs:

template::get_mime_type

template::register_mime_type

adp_parse_ad_conn_file

and these pages:

openacs-4/www/blank-master.adp
openacs-4/www/blank-master.tcl

It seems possible with a few line changes and having a blank-master for xml and another for html. If some procedure gets complicated dealing with xml versus html conditions, just create a proc for each of the 2 cases.

What part of the templating system would not work with separate xml and html blank-master templates (and modifications to above procs)?

Collapse
12: Re: Moving to XHTML (response to 11)
Posted by Gustaf Neumann on
There are two different issues: (a) encoding the HTML document such the result is valid XHTML (1.0, 1.1, ..) and (b) telling the user agent (browser) that the media type (content-type) is valid XHTML.

The plugin of wordpress just alters the the media type according to the "accept" request header field (see rfc 2616, section 14.1) and sends in both cases the identical file. Same seems to happen with www.w3.org. Note, that this is only possible for XHTML 1.0, not for XHTML 1.1 or newer. For just altering the media-type i don't see the need of having different master templates ("ns_set update [ns_conn outputheaders] Content-Type" should be sufficient). For purpose (a) there is no other option than working though the code. XHTML 1.1 is a modularized version of XHTML 1.0 with only little differences, but XHMTL 2.0 won't support e.g. the <IMG> tag, this will be an even bigger step (XHTML 2.0 is not released).

For now XHTML 1.0 Transitional is already an ambitious target.