Hi I have a problem creating valid HTML 4 with Zope. It seems that Zope inserts a <base> tag when calling an index_html document without specifying the file: <base href="http://127.0.0.1:8080/" /> If I type in my browser "http://127.0.0.1:8080/" Zope adds the base tag. If I type "http://127.0.0.1:8080/index_html", it doesn't. Sadly the way it creates this tag is not valid HTML 4.01 strict (or transitional) according to validator.w3.org. We want to use W3's icons on the sites we're building, as it seems the closest thing to a certificate for quality-HTML. (Basically it something that helps selling.) The offending thing is the XML-like ending. " />" If I remove the space-slash from the code, it validates. I assume that I could suppress this somewhere in the source code (possibly HTTPResponse.py), but I'm not sure where and how. I'm using Zope 2.4, but found this "feature" to exist in Zope 2.6 as well. Can somebody help generating valid HTML 4.01? :-) Cheers Marc
On Thu, Feb 27, 2003 at 11:14:59AM +0000, Marc Burgauer wrote:
Hi
I have a problem creating valid HTML 4 with Zope. It seems that Zope inserts a <base> tag when calling an index_html document without specifying the file:
<base href="http://127.0.0.1:8080/" />
yes, this is necessary or else relative URLs will not work. if you view http://foo:8080/bar/, without the base tag, the browser will treat a link in bar/index_html e.g. <a href="baz"> as http://foo:8080/baz instead of the intended http://foo:8080/bar/baz.
If I type in my browser "http://127.0.0.1:8080/" Zope adds the base tag. If I type "http://127.0.0.1:8080/index_html", it doesn't. Sadly the way it creates this tag is not valid HTML 4.01 strict (or transitional) according to validator.w3.org. We want to use W3's icons on the sites we're building, as it seems the closest thing to a certificate for quality-HTML. (Basically it something that helps selling.)
The offending thing is the XML-like ending. " />" If I remove the space-slash from the code, it validates.
I assume that I could suppress this somewhere in the source code (possibly HTTPResponse.py), but I'm not sure where and how.
You're correct - ZPublisher/HTTPResponse.py, the method is insertBase and the offending slash is added around line 313 as of zope 2.5.1. you'll have to either patch the source or use a "monkey patch." http://www.zope.org/Members/Caseman/Dynamic_Hotfix -- Paul Winkler http://www.slinkp.com
MB> I have a problem creating valid HTML 4 with Zope. It seems that Zope inserts MB> a <base> tag when calling an index_html document without specifying the MB> file: MB> <base href="http://127.0.0.1:8080/" /> It was changed a while ago (2.3 ?) to make it conform with XHTML 1.0 (which is essentially the same as HTML 4.01) , the *current* reccomendation from W3c http://www.w3.org/MarkUp/ This info does of course not help you solve you problem, if you still want to do HTML 4.0 ;) if you really want to change it, either insert your base tags yourself, and zope will leave you alone, or change HTTPResponse.py in your zope installation. (it is in line 448 in my installation, but may have changed...) -- Geir Bækholt
Geir Thanks for pointing out where to find the piece of code. I might just remove it. I want to do HTML 4.01 strict. (Sorry about being misleading, I do not want to do plain 4.) The generated tag is NOT valid 4.01, neither for strict nor transitional, at least according to the W3 validator. It might be valid XHTML 1.0, but that's not an option. Cheers Marc
MB> I have a problem creating valid HTML 4 with Zope. It seems that Zope inserts MB> a <base> tag when calling an index_html document without specifying the MB> file:
MB> <base href="http://127.0.0.1:8080/" />
It was changed a while ago (2.3 ?) to make it conform with XHTML 1.0 (which is essentially the same as HTML 4.01) , the *current* reccomendation from W3c http://www.w3.org/MarkUp/
This info does of course not help you solve you problem, if you still want to do HTML 4.0 ;)
if you really want to change it, either insert your base tags yourself, and zope will leave you alone, or change HTTPResponse.py in your zope installation. (it is in line 448 in my installation, but may have changed...)
-- Geir Bækholt
Marc Burgauer wrote at 2003-2-27 11:14 +0000:
I have a problem creating valid HTML 4 with Zope. It seems that Zope inserts a <base> tag when calling an index_html document without specifying the file:
<base href="http://127.0.0.1:8080/" />
Zope does not insert a "base" tag when there is already one. That may be an easy way for you to work around your problem. As someone else suggested: <base href="&dtml-absolute_url;"> (DTML) or <base tal:attributes="href here/absolute_url"> might be adequate. More details: --> search mailing list archives. Your problem is almost an FAQ. Dieter
participants (4)
-
Dieter Maurer -
Geir Bækholt -
Marc Burgauer -
Paul Winkler