W3C Validator gives error. (html very simple code)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Harry Cho
    New Member
    • Mar 2011
    • 1

    W3C Validator gives error. (html very simple code)

    Hello
    Following code gives me error when I try to validate it from validator.w3.or g. I copied this code from book and image file is in the same folder as html file. Help me out.
    Code:
    <?xml version = "1.0" encoding = "utf-8">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns = "http://www.w2.org/1999/xhtml">
    	<head>
    		<title>Images</title>
    	</head>
    
    	<body>
    		<p>
    			<img src = "Desert.jpg" width = "1024" height = "768"
    				alt = "The Desert" />
    
    		</p>
    	</body>
    </html>

    1. Error Line 17, Column 8: entity end not allowed in processing instruction

    </html>

    2. Error Line 17, Column 8: end of document in prolog

    </html>

    This error may appear when the validator receives an empty document. Please make sure that the document you are uploading is not empty, and report any discrepancy.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    You are missing the closing '?' of your xml declaration. Should be:
    Code:
    <?xml version = "1.0" encoding = "utf-8"?>
    Do not use this! Unless you are serving as XHTML, only modern browsers know what to do with that line while most versions of IE just go into quirks mode. You should leave that line out.

    Comment

    Working...