Stripping HTML tags or not [WAS: (something like) making static pages dynamic] dynamic]
A recent discussion on the list concerned how to strip the usual tags from the beginning and end of a static html document produced by a wysiwyg editor and replace the tags with the standard_html_header and standard_html_footer. On my site, my standard_html_headers and standard_html_footers are customized to the type of document, so that I have created a ZClass for each type. Each ZClass is a folder and has an index_html <dtml-var standard_html_header> <dtml-var content> <dtml-var standard_html_footer> so that the content managers only have to upload the content and not worry about the headers and footers. Within this context, if a manager uses Netscape Publisher and publishes, for example, to http://mysite/Zope/../(ZClassInstance)/content, content will contain the set of tags produced by Publisher. At this point, the source of a rendering of the document will contain two sets of <head>, <body>, etc. tags. However, in Netscape Navigator, the extra tags seem to be ignored and the page appears the same as if the extra tags have been stripped out. This raises several questions: 1) Does the HTML standard say that browsers should ignore the extra tags? 2) If not, do all or most other browsers ignore the extra tags anyway? If the answer to either question is yes, then as a practical matter it is not necessary to strip out the extra tags as long as the standard_html_header and standard_html_footer enclose them. I should note that in my case the standard_html_header sets up a table with a side bar in the first column so that content is inside a table element. I don't know if the extra tags would be ignored under other conditions. Al -- Albert Kinderman California State University, Northridge Department of Management Science albert.kinderman@csun.edu
At 13:37 13-10-99 , Albert Kinderman wrote:
A recent discussion on the list concerned how to strip the usual tags from the beginning and end of a static html document produced by a wysiwyg editor and replace the tags with the standard_html_header and standard_html_footer. On my site, my standard_html_headers and standard_html_footers are customized to the type of document, so that I have created a ZClass for each type. Each ZClass is a folder and has an index_html
<dtml-var standard_html_header> <dtml-var content> <dtml-var standard_html_footer>
so that the content managers only have to upload the content and not worry about the headers and footers. Within this context, if a manager uses Netscape Publisher and publishes, for example, to http://mysite/Zope/../(ZClassInstance)/content, content will contain the set of tags produced by Publisher.
At this point, the source of a rendering of the document will contain two sets of <head>, <body>, etc. tags. However, in Netscape Navigator, the extra tags seem to be ignored and the page appears the same as if the extra tags have been stripped out.
This raises several questions:
1) Does the HTML standard say that browsers should ignore the extra tags?
No, the behaviour is undefined. Some browsers will use the first body tag, others will use the last, and some will just break.
2) If not, do all or most other browsers ignore the extra tags anyway?
Depends on the browser, and differs from platform to platform and from version to version.
If the answer to either question is yes, then as a practical matter it is not necessary to strip out the extra tags as long as the standard_html_header and standard_html_footer enclose them.
I should note that in my case the standard_html_header sets up a table with a side bar in the first column so that content is inside a table element. I don't know if the extra tags would be ignored under other conditions.
Generally not a good idea. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ---------------------------------------------
participants (2)
-
Albert Kinderman -
Martijn Pieters