CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   XML (http://www.codingforums.com/forumdisplay.php?f=3)
-   -   Help Validating XHTML Strict 1.0 (http://www.codingforums.com/showthread.php?t=284096)

Yedya 12-13-2012 06:13 PM

Help Validating XHTML Strict 1.0
 
Need some help validating this,can't seem to find the error at all...

Its for college btw.

Error taken from W3 Schools XHTML Validator
Error Line 99, Column 7: end tag for "div" omitted, but OMITTAG NO was specified

</body>


You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".


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.w3.org/1999/xhtml">

    <head>
        <title>BF3</title>
                <link rel="stylesheet" type="text/css" href="Project.css"/>
    </head>


<body>


 <div id="page">
<img src="Fields_wallpapers_411.jpg"alt="Top Part" height="300" width="1000"/>
 <div id="nav_bar">
    <ul>
        <li><a href="index.html">Home      </a></li>
        <li><a href="tickets.html">Weapons  </a></li>
        <li><a href="members.html" class="Classes">
            Maps</a></li>
        <li><a href="about_us.html">Vehicles</a></li>
        <li><a href="about_us.html">Factions</a></li>
        <li><a href="about_us.html">Tips &amp; Tricks</a></li>
    </ul>
</div>


<div id="homepage">


<div id="title"><h2>Welcome to my Battlefield 3 site.</h2></div>
<p>Battlefield 3 (commonly abbreviated BF3) is a first-person shooter video game developed by EA Digital Illusions CE and published by Electronic Arts.
It is a direct sequel to 2005's Battlefield 2, and the twelfth installment in the Battlefield franchise.


The game was released in North America on 25 October 2011 and in Europe on 28 October 2011 for Microsoft Windows, PlayStation 3, and Xbox 360.
EA Mobile also confirmed a port for the iOS platform. The game sold 5 million copies in its first week of releaseand received critical acclaim from most game reviewers.
It is the first game in the series that does not support versions of Windows prior to Windows Vista as the game only supports DirectX 10 and 11.
The PC version is exclusive to EA's Origin platform,through which PC users also authenticate when connecting to the game.

In campaign mode, players take on the personas of several military roles; a Force Recon Marine, an F/A-18 weapons system officer,
an M1A2 Abrams tank operator, and a GRU Spetsnaz operative. The campaign takes place at various locations, from Iran to New York,
 and follows the story of Sergeant Henry Blackburn and later, Dimitri Mayakovsky. </p>




<h2> Campaign </h2>
<p>The game's campaign takes place in the year 2014. The missions are flashbacks that are part of the interrogation of Staff Sergeant Blackburn and do not occur in order of events.
Chronologically, the initial sections of the campaign are set near the Iraq-Iran border, where the US Marine Corps are fighting the People's Liberation and Resistance (PLR).
The game later moves into northern Iran, continuing the fight against the PLR. There is a mission set in the streets of Paris, and another set in the sewers and subways of New York.</p>


<div id="review">

  <h2> <a href="http://battlelog.battlefield.com/bf3/about/game/armored-kill/">Armored Kill OUT NOW</a></h2>


      <p><i>OnPS3,XBOX 360 & PC      </i></p>



        <img src="Armoud Kill.png"alt="Top Part"/>
 </div>


<p>Click Below Image to Order Now<a href="http://battlelog.battlefield.com/bf3/premium/">
<img src="Battlefield-3-Premium.jpg" alt="Preium" width="480" height="500"/></a></p>






<h2>Downloadable Content</h2>
 <ol>
    <li><i>Back To Karkand  </i></li>
    <li><i>Close Quaters    </i></li>
    <li><i>Amored Kill      </i></li>
    <li><i>Aftermath        </i></li>
    <li><i>Endgame          </i></li>
 </ol>




<img src="bf3_small_feature_promo_usp1.jpg"alt="Top Part" height="300" width="350"/>

  <img src="bf3_small_feature_promo_usp2.jpg"alt="Top Part" height="300" width="280"/>

    <img src="bf3_small_feature_promo_usp3-2.jpg"alt="Top Part" height="300" width="360"/>


</div>



</body>

</html>


Alex Vincent 12-14-2012 07:39 AM

We have a policy of not doing other people's homework, but we do offer hints.

Usually when I have a well-formedness problem like this that I can't solve, I make a copy of the document in question. Then I take the copy and start removing sections that I know are good. Eventually, I'll isolate where I went wrong. This is a technique that works really well in any scripting language, too.

Another option is to use an editor that supports either code folding or syntax highlighting. Komodo Edit does both, and it's free: I've used it for years. I suspect that with code folding, you'll find the error within minutes. :thumbsup:

Yedya 12-14-2012 01:34 PM

Ok thanks :) can you suggest and editor? Seeing as its only one error can you give me a BIG Clue,need to get this validated today

tracknut 12-14-2012 03:12 PM

It's telling you that you have opened a <div> but have not closed it with a corresponding </div>. You could count the <div> elements and see there is one less </div>. Just pair them up and decide where you forgot a <div>. You could also put a comment (like <!-- end of "page" div -->) at each of the </div> and it might make it easier to spot a missing one.

Dave

Alex Vincent 12-14-2012 06:13 PM

Quote:

Originally Posted by Yedya (Post 1299835)
Ok thanks :) can you suggest and editor? Seeing as its only one error can you give me a BIG Clue,need to get this validated today

I already did, Komodo Edit: http://www.activestate.com/komodo-edit/downloads

P.S. When I tried your document in Komodo, it wasn't just one error... that's how XML works: at the first well-formedness error, it stops processing.

P.P.S. Try http://validator.w3.org/#validate_by_upload for validation. :-)

Yedya 12-14-2012 06:14 PM

Thank you! Fixed the error and now the validator is throwing out more errors
Quote:

Line 62, Column 35: Couldn't find end of Start Tag img line 62
<img src="Armoud Kill.png"alt="Top Part"/>
6 of these? and i honestly don't see where its wrong in the code...

Alex Vincent 12-14-2012 06:20 PM

Code:

<img src="Armoud Kill.png"alt="Top Part"/>
What's wrong here?

Yedya 12-14-2012 06:54 PM

Quote:

Originally Posted by Alex Vincent (Post 1299903)
Code:

<img src="Armoud Kill.png"alt="Top Part"/>
What's wrong here?

Nothing according to this


Code:

<img border="0" src="/images/pulpit.jpg" alt="Pulpit rock" width="304" height="228">
taking from


http://www.w3schools.com/html/tryit....ml_pulpitimage


I actually am so stressed now :(

Yedya 12-14-2012 07:40 PM

Not seeing any error :( this is so stressful


I checked on w3 shools and according to that site thats thew way your meant to link images. :(

tracknut 12-14-2012 07:54 PM

Let'ssee,howdoIputthismoreclearly.Stepbackandlookatthecodeasfarasitneedstobeparsedintoindividualtags ,attributesandstrings...Dave

Yedya 12-14-2012 08:06 PM

Quote:

Originally Posted by tracknut (Post 1299935)
Let'ssee,howdoIputthismoreclearly.Stepbackandlookatthecodeasfarasitneedstobeparsedintoindividualtags ,attributesandstrings...Dave

So it needs to be parsed into individual tags? I have no idea how to do that..
Im not asking for alot,just a few simeple errors...im new to programming



Guess il go google it.

tracknut 12-14-2012 08:15 PM

Sorry, I thought that would have given you the tip. Tags and attributes in html are separated by white space (spaces, tabs, returns) so that your browser knows where they start and end. The formatting of html is rather loose, but you do need to adhere to a few common rules like that. That line of code is missing white space between the string and the following attribute.

Dave

Yedya 12-14-2012 08:22 PM

Many thanks man! Really appreciate it,its passed now :cool:

Alex Vincent 12-14-2012 09:52 PM

So, what'd you learn from this? :) Don't just quote Dave - put it in your own words.

(I'm in college myself - but I enjoy taking the role of a mentor from time to time.)


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.