- Post ID 190943

User 2287960 Photo


Ambassador
580 posts

I'm sure I've seen this mentioned before but I can not find the post.

I am doing some changes to index.html and I notice the first line is:

<?xml version="1.0" encoding="iso-8859-1"?>

Second line is DOCTYPE statement.

Is that first line correct?

Keith
User 1948478 Photo


Senior Advisor
1,850 posts

The line would have been correct as a first-line declaration in an .xml document, but I see no reason for it to appear in an html file. The DOCTYPE line should always be the very first line in any html document, so I would remove that xml declaration. ;)
User 2287960 Photo


Ambassador
580 posts

Per

Thanks for your view here is what I have:

1.<?xml version="1.0" encoding="iso-8859-1"?>
2.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3.<html xmlns="http://www.w3.org/1999/xhtml">

I am suggesting that CC has added this, I believe all I originally put was:

1.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2.<html>

Keith
User 1948478 Photo


Senior Advisor
1,850 posts

Sorry, it didn't occur to me that you might be using XHTML.
I am not very familiar with XHTML, but I seem to recall that the <?xml......> declaration is needed there!

EDIT: I'm not sure, though, how you could have ended up with XHTML if you indeed started out specifying HTML 4.01 :/
User 2073552 Photo


Registered User
1,625 posts

The only way that could have been added is if you copy and pasted the code into a new file and did not remove it. The Editor will not add something automatically. :P
"An Apple doth not fall far from its tree, yet an orange does."

https://lbwebsitedesign.com - Responsive Web Design & Web Hosting Services.
http://helpsite.sirage.com - HTML5, CSS3 and CC Help Video Blog.
User 2287960 Photo


Ambassador
580 posts

SirAGE

You could well be right, but I thought I had read something similar here before.

I was looking at the code cleaner the other day and I thought that did make changes, I'll check that again and post results if that happens.

Keith
User 235128 Photo


Registered User
33 posts

Similar problem here.

Started 2 html files with CC. Debugging went fine on my local machine. CC preview screen and the various browsers on my local system rendered the pages properly.

Uploaded the files to the public server and they generated blank pages in the browser. They caused the public server to generate an "Internal Server Error".

Tracked it down to the <?xml version...> line at the top of the files.
Deleting that line fixed the problem on the public server.

Not sure which type of document I selected in the CC start new page wizard.
User 2073552 Photo


Registered User
1,625 posts

I may get a hand slap for this post but I would suggest NOT using the Code cleaner at this moment in time. It is a little out of wack and does not work properly as to my testing.
"An Apple doth not fall far from its tree, yet an orange does."

https://lbwebsitedesign.com - Responsive Web Design & Web Hosting Services.
http://helpsite.sirage.com - HTML5, CSS3 and CC Help Video Blog.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.