Click to See Complete Forum and Search --> : setting Doctype is slowing down my website ??
gbonnet
05-15-2008, 10:32 AM
Hi all,
I wanted to make my site compatible with W3C standards but I have issues with the doctype. In theory, setting the doctype should not slow down the load time of the page (or at least not enough to be noticed by visitors).
For testing purposes I set a doctype in a deep page of my site so it can remain unoticed :
http://www.blueface.ie/phonebook/help.aspx
I tried with IE and FF and with both browsers, it seems stuck at the beginning (as if the server was slow to answer the querry)
The only difference between this page and the pages next to it is the doctype declaration ...
<xsl:output doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />
I really would like to avoid browsers to view my site in quirk mode.
If anyone has an idea ...
Thanks in advance
G.
sstalder
05-15-2008, 11:42 AM
First fix these errors: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.blueface.ie%2Fphonebook%2Fhelp.aspx&charset=%28detect+automatically%29&doctype=Inline&group=0
Another thing I noticed is in your pages code there you have this code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
You shouldn't be declaring the page as an XML document then declaring as a html document, im sure that could cause some issues?
I also don't know why you have "[]>" at the end of your doctype tag. Remove the "[]" and just close with ">".
Let me know if that helps.
gbonnet
05-15-2008, 12:22 PM
Hi sstalder,
Thanks for your prompt answer.
I have no idea why there are these "[]" at the end of the doctype...
Here is the way I call it in my xsl file (which seems to be perfectly valid):
<xsl:output omit-xml-declaration="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
As you can see I tried no to take into account the XML declaration and it didn't change anything.
Regarding the errors, I know ... but I don't know how to ... That's a tricky thing.
I posted something about that but no one had a clue : http://www.webdeveloper.com/forum/showthread.php?t=180146
There seem to be something wrong with the XSLT on my server ...
moved thread to a more proper forum ...
gbonnet
05-15-2008, 05:57 PM
moved thread to a more proper forum ...
Sorry about that ...
Major Payne
05-16-2008, 12:30 AM
A proper doctype declarion for XHTML 1.0 is just this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
See DocTypes (http://www.w3.org/QA/2002/04/valid-dtd-list.html).
Doesn't do any good to have a proper doctype if the coding doesn't follow:
HTML Code Errors (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.blueface.ie%2Fphonebook%2Fhelp.aspx)
That's reported by the w3c.org, but HTML Tidy is reporting 243 code errors for site. 90% is concerned with whitespace in URL tags:
Yours: <a href="http://www.blueface.ie/phonebook/help.aspx
 ">
Phone Book Help</a>
That's a no-no.
Ron
gbonnet
05-16-2008, 03:23 AM
Hi Ron,
Thanks for your tips.
I'll correct the URLs that's due to the XSLT, it's easy to fix.
Regarding the doctype, the way I set it is fine in XSL. What I suspect is that there is a problem with my XSLT processor. We are using our own and it has some small imperfections I suppose.
Cheers
G.