Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you find the html version from source code. 2

Status
Not open for further replies.

stephane.bouchard2

Technical User
Oct 2, 2018
4
CA
I have tried to figure out which version of html I am dealing with, but there are inconsistencies.
Q1: I have looked at !DOCTYPE html which I believe tells me it is HTML1.0. But should all!DOCTYPE show which version it has?

My main goal is to identify the version and if a version HTML1.0 is found I must convert it to HTML2.0.

Q2: Can dreamweaver 2014 1.1 convert HTML1.0 TO 2.0? If not, what would be the best approach?

Thanks.
 
Hi spamjim, I love that validator. Here is what I got:

Source
1.<!doctype html>↩
2.↩
3.<!--[if lt IE 9]>↩
4.<html class="no-js lt-ie9" dir="ltr" lang="en" xmlns="5.<![endif]-->↩
6.<!--[if gt IE 8]><!-->↩
7.<html class="no-js" dir="ltr" lang="en" xmlns="8.<!--<![endif]-->↩
9. <head>↩
10. ↩
11.<meta http-equiv="X-UA-Compatible" content="IE=edge">↩
12.<meta charset="utf-8">↩


...Still looking for the type of HTML or XHTML?
 
The idea of a validator is to see if a document aligns with what you think the document should be. If you're using markup throughout the document that does not align with what you have declared, browsers will likely ignore your declaration.

That means, if you start with...
Code:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">

...but include some markup that only appears in HTML5, you should not expect this to be a true HTML2 document.

Why are you wanting to convert from a 20+ year old specification to another 20+ year old specification?

The line you have shared...

Code:
<meta http-equiv="X-UA-Compatible" content="IE=edge">

...suggests you are not actually dealing with HTML1 or HTML2 because this markup didn't exist 20 years ago.
 
I tend to agree with you. I am trying to make sense of the work I am being given. I know some about HTML, but people here aren't always sure of what they are talking about, and it makes my work much more difficult. It's okay, I know ultimately I will figure this out with some help. lol

I believe what they want me to do is to convert XHTML2.0 or older to XHTML4.0 not higher. I have noticed that in some source code from recent pages the word HTML4 is used, does it mean XHTML4, what is the difference?

Thanks again.

Sincerely.
 
The internet is a much better authority on the differences of these.

I'm still unclear about the requirement to update/convert to another standard. That is not usually needed for archived/legacy content. The idea is that if your doctype refers to something from 1998 and properly restricts its markup to that doctype, a modern browser will still know how to render that properly. The problem happens when you change the doctype but leave the original markup (or the opposite).

To that end, it may be best to just use a validator and set it to your target intent (HTML4, unaware of XHTML4). Then review/correct the bad markup that it flags.
 
That makes sense. Thank you so much for your great insights.

Sincerely,

Stephane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top