Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > xhtml Validation

Reply
Thread Tools

xhtml Validation

 
 
Jimbo
Guest
Posts: n/a
 
      10-04-2003
I have tried validating a very simple xhtml page using w3's validator
software found here: http://validator.w3.org/ but I keep getting the
standard error message:
I was not able to extract a character encoding labeling from any of the
valid sources for such information. Without encoding information it is
impossible to validate the document. The sources I tried are:

a.. The HTTP Content-Type field.
b.. The XML Declaration.
c.. The HTML "META" element.
Could anyone tell me if I am doing something wrong? Here is my xhtml page
code:

<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!-- Fig. 4.5: links.html -->
<!-- Introduction to hyperlinks -->

<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>Internet and WWW How to Program - Links</title>
</head>

<body>

<h1>Here are my favorite sites</h1>

<p><strong>Click on a name to go to that page.</strong></p>

<p><a href = "http://www.deitel.com">Deitel</a></p>

<p><a href = "http://www.prenhall.com">Prentice Hall</a></p>

<p><a href = "http://www.yahoo.com">Yahoo!</a></p>

<p><a href = "http://www.usatoday.com">USA Today</a></p>

</body>
</html>


 
Reply With Quote
 
 
 
 
Hywel Jenkins
Guest
Posts: n/a
 
      10-04-2003
In article <bln31g$ftk$(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed) says...
> I have tried validating a very simple xhtml page using w3's validator
> software found here: http://validator.w3.org/ but I keep getting the
> standard error message:
> I was not able to extract a character encoding labeling from any of the
> valid sources for such information. Without encoding information it is
> impossible to validate the document. The sources I tried are:
>
> a.. The HTTP Content-Type field.
> b.. The XML Declaration.
> c.. The HTML "META" element.
> Could anyone tell me if I am doing something wrong? Here is my xhtml page
> code:


You need some information about the character encoding in your <head>.
For example:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-
1" />


--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      10-04-2003
Jimbo wrote:

> I have tried validating a very simple xhtml page using w3's validator
> software found here: http://validator.w3.org/ but I keep getting the
> standard error message:
> I was not able to extract a character encoding labeling


http://www.htmlhelp.com/tools/validator/charset.html

> Could anyone tell me if I am doing something wrong? Here is my xhtml page
> code:
>
> <p><strong>Click on a name to go to that page.</strong></p>


Its safe to assume that people know how to use a link. Not everybody
"clicks" to trigger a link though.

> <p><a href = "http://www.deitel.com">Deitel</a></p>
> <p><a href = "http://www.prenhall.com">Prentice Hall</a></p>
> <p><a href = "http://www.yahoo.com">Yahoo!</a></p>
> <p><a href = "http://www.usatoday.com">USA Today</a></p>


These look more like list items then paragraphs.

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
DU
Guest
Posts: n/a
 
      10-04-2003
Jimbo wrote:
> I have tried validating a very simple xhtml page using w3's validator
> software found here: http://validator.w3.org/ but I keep getting the
> standard error message:
> I was not able to extract a character encoding labeling from any of the
> valid sources for such information. Without encoding information it is
> impossible to validate the document. The sources I tried are:
>
> a.. The HTTP Content-Type field.
> b.. The XML Declaration.
> c.. The HTML "META" element.
> Could anyone tell me if I am doing something wrong? Here is my xhtml page
> code:
>
> <?xml version = "1.0"?>


I suggest you get rid of this <?xml version = "1.0"?>
for only 1 important and importantissimo reason:

When MSIE 6 for windows parses an html file, if the very first
instruction is a doctype in strict DTD, it will render the page in
standards compliant rendering mode (where, for instance, the box model
is compliant with W3C CSS1 TR). Otherwise, such in this case, it will
render the page in backward compliant rendering mode, therefore using an
invalid and incorrect CSS1 box model.

"An XML declaration is not required in all XML documents; however XHTML
document authors are strongly encouraged to use XML declarations in all
their documents."
http://www.w3.org/TR/2002/REC-xhtml1-20020801/#strict

Here, you have a very good and very defendable reason why you want to
remove that xml declaration.


> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> <!-- Fig. 4.5: links.html -->
> <!-- Introduction to hyperlinks -->
>
> <html xmlns = "http://www.w3.org/1999/xhtml">
> <head>
> <title>Internet and WWW How to Program - Links</title>



I personally always add these lines in the <head> part of my files:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="date" content="2003-10-03T14:05:46+05:00" />
<meta http-equiv="imagetoolbar" content="no" />

That last instruction prevents the image toolbar from appearing when
someone in MSIE 6 for Windows hovers his mouse over an image.

> </head>
>
> <body>
>
> <h1>Here are my favorite sites</h1>
>
> <p><strong>Click on a name to go to that page.</strong></p>
>


Like others who answered you, this sort of "instruction manual"-like
directive is not really useful nor necessary. Adding an
a:hover {}
css rule for your links will be sufficient enough.

> <p><a href = "http://www.deitel.com">Deitel</a></p>
>


Spaces between attribute names and attributes values (in between = sign)
are not necessary and
1- need to be removed anyway when the browser makes a syntaxical
analysis of the source code
2- coloring code editors will be confused and will not render the proper
color for attribute names and attribute values
so it's best to avoid adding spaces like that

> <p><a href = "http://www.prenhall.com">Prentice Hall</a></p>
>
> <p><a href = "http://www.yahoo.com">Yahoo!</a></p>
>
> <p><a href = "http://www.usatoday.com">USA Today</a></p>
>
> </body>
> </html>
>
>


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

 
Reply With Quote
 
Eric B. Bednarz
Guest
Posts: n/a
 
      10-04-2003
DU <(E-Mail Removed)> writes:

> Jimbo wrote:


>> <?xml version = "1.0"?>

>
> I suggest you get rid of this <?xml version = "1.0"?>
> for only 1 important and importantissimo reason:
>
> When MSIE 6 for windows parses an html file, if the very first
> instruction is a doctype in strict DTD,


A what?

> it will render the page in
> standards compliant rendering mode (where, for instance, the box model
> is compliant with W3C CSS1 TR). Otherwise, such in this case, it will
> render the page in backward compliant rendering mode, therefore using
> an invalid and incorrect CSS1 box model.


Which spares you the trouble to compare the results with versions prior
to 6, spares you the trouble to solve a couple of bugs IE6 only sports
in so-called 'standards compliant' mode and spares you the trouble of
double-checking what IE6 does when 3rd party software like ad-blocking
proxies insert anything before the docHype declaration.

Of course, since M$IE cannot handle XHTML in the first place, we're
talking about serving XHTML syntax as text/html. The newsgroup
discussing voodoo is all the way down the corridor, 2nd door to the
left.


--
"In America the young are always ready to give to those who are older
than themselves the full benefits of their inexperience."
--Oscar Wilde
 
Reply With Quote
 
DU
Guest
Posts: n/a
 
      10-05-2003
Eric B. Bednarz wrote:
> DU <(E-Mail Removed)> writes:
>
>
>>Jimbo wrote:

>
>
>>> <?xml version = "1.0"?>

>>
>>I suggest you get rid of this <?xml version = "1.0"?>
>>for only 1 important and importantissimo reason:
>>
>>When MSIE 6 for windows parses an html file, if the very first
>>instruction is a doctype in strict DTD,

>
>
> A what?
>


doctype declaration: public identifier and system identifier.

>
>>it will render the page in
>>standards compliant rendering mode (where, for instance, the box model
>>is compliant with W3C CSS1 TR). Otherwise, such in this case, it will
>>render the page in backward compliant rendering mode, therefore using
>>an invalid and incorrect CSS1 box model.

>
>
> Which spares you the trouble to compare the results with versions prior
> to 6, spares you the trouble to solve a couple of bugs IE6 only sports
> in so-called 'standards compliant' mode and spares you the trouble of
> double-checking what IE6 does when 3rd party software like ad-blocking
> proxies insert anything before the docHype declaration.
>
> Of course, since M$IE cannot handle XHTML in the first place, we're
> talking about serving XHTML syntax as text/html. The newsgroup
> discussing voodoo is all the way down the corridor, 2nd door to the
> left.
>
>


I tried to bring up a constructive and positive reply along with
suggestions to the OP. If your concern is about previous versions of
MSIE prior to version 6, then there are well known workarounds (tested,
verified and working) for MSIE 5.x incorrect box model.

Box Model Hack
http://tantek.com/CSS/Examples/boxmodelhack.html

Modified Simplified Box Model Hack
http://www.info.com.ph/~etan/w3panth...ifiedsbmh.html

AvoidingHacks
http://css-discuss.incutio.com/?page=AvoidingHacks

etc..

But before we discuss MSIE 5.x incorrect box model and how to
compensate, adjusting the source code, it should be known that a wide
majority of independent sources converge to say that more than 50% of
all web browsers in use on the web today is MSIE 6 for windows. if MSIE
6 is compliant with W3C web standards in a wide, large part, then why
not conform webpages to valid markup syntax, CSS1 properties and DOM1
attributes and methods?

It is in the best interests of web designers to make their page trigger
standards compliant rendering mode in MSIE 6 for windows for hundreds of
reasons. Many organizations and professional web designers have insisted
during months and years that Microsoft fix its broken box model. Now,
that it has been fixed in version 6, it's up to so-called web designers
to follow up on their own request and to be consequent, coherent.
Anything else is just jabbering cretinism dancing in colorized obscurantism.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

 
Reply With Quote
 
Micah Cowan
Guest
Posts: n/a
 
      10-05-2003
Hywel Jenkins <(E-Mail Removed)> writes:

> In article <bln31g$ftk$(E-Mail Removed)>, (E-Mail Removed) says...
> > I have tried validating a very simple xhtml page using w3's validator
> > software found here: http://validator.w3.org/ but I keep getting the
> > standard error message:
> > I was not able to extract a character encoding labeling from any of the
> > valid sources for such information. Without encoding information it is
> > impossible to validate the document. The sources I tried are:
> >
> > a.. The HTTP Content-Type field.
> > b.. The XML Declaration.
> > c.. The HTML "META" element.
> > Could anyone tell me if I am doing something wrong? Here is my xhtml page
> > code:

>
> You need some information about the character encoding in your <head>.
> For example:
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-
> 1" />


Isn't this a work-around for a buggy validator? If no external
charset information is available and the document is clearly XML
(via the XML declaration), and no character encoding is specified
in that declaration, then the character encoding *must* be one of
UTF-8 or UTF-16 (and the latter only if the Byte Order Mark is
present), right?

However, I do realize that the user agent "must not" assume a
character set for HTTP if none are indicated--though I think in
this case, it is clearly implied to be UTF-8. Anyway, I think
that "must not" rule is pretty silly at any rate: ASCII or a
derivative such as ISO-8859-1 or windows codepage 1250/1252 are
likely "best guesses".

-Micah
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs XML 0 08-02-2011 05:40 AM
PSD to XHTML Conversion, PSD to HTML, Joomla, Drupal, WordpressConversion, PSD to XHTML CSS xhtml champs C Programming 0 08-01-2011 06:29 AM
convert xhtml to another xhtml using xslt Usha2009 XML 0 12-20-2009 01:13 PM
Should I Convert Site To XHTML or XHTML mobile? chronos3d HTML 9 12-05-2006 04:46 PM
parse URL (href) from xhtml, xhtml -> text, for data hawat.thufir@gmail.com XML 7 02-08-2006 07:39 PM



Advertisments