The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Meaning of "Top Level Element", Can't validate XHTML1
PhilOfPerth
post Feb 27 2007, 07:17 PM
Post #1





Group: Members
Posts: 6
Joined: 27-February 07
From: Perth, Western Australia
Member No.: 2,049



Hi. I'm trying to validate some pages to XHTML1 Transitional. The page is working and displaying ok but TV says "Only one top-level element is allowed in an XML document". What does this mean and how do I correct it?
Here are the couple of lines of code:
<body>
<h1 align="center">Discussion Board</h1>
<p align="center">
<img alt="parentmeeting" src="pics/parentmeeting.jpg" height="95" width="125"border=0></p>
<p>A place to pass on tips, ask questions, and relate experiences.
The error points to the <body> tag itself.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Feb 27 2007, 07:23 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Can you provide the URL (address) of a document that demonstrates the problem?

Taking a guess, there is something other than a single head element and a single body element inside your html element.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
PhilOfPerth
post Feb 28 2007, 05:54 PM
Post #3





Group: Members
Posts: 6
Joined: 27-February 07
From: Perth, Western Australia
Member No.: 2,049



This is the code for the whole page. I don't think I've doubled up on anything though:

<head>
<title>discussion</title>
</head>
<body>
<h1 align="center">Discussion Board</h1>
<p align="center">
<img alt="parentmeeting" src="pics/parentmeeting.jpg" height="95" width="125"border="0"></p>
<p>A place to pass on tips, ask questions, ... (etc)
<br><br>
<table align="center" bgcolor="cyan"border=4 cellspacing=4 cellpadding=4 width="100%">
(several <tr> and <td> entries follow here)
</table
<br>
<p align="center"><a href="mailto:spk1@optusnet.com.au ?subject=Letter for LEFDC website Discussion Board">Post a Letter</a>
<img alt="spacercyan " src="pics/spacer.gif" height="1" width="20" />
<a href="map.html">Back to Map</a></p>
</body>

</html>

This post has been edited by PhilOfPerth: Feb 28 2007, 05:58 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 28 2007, 06:14 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



I don't think the validator says that about the snippet you posted. If you write XHTML I assume you have doctype, for instance. Please provide the URL to the full document instead. smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Feb 28 2007, 06:17 PM
Post #5


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



It could be complaining about the </table that should be changed to </table>

Or maybe it's complaining about the mish-mash of HTML and XHTML syntax.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
PhilOfPerth
post Mar 1 2007, 08:00 PM
Post #6





Group: Members
Posts: 6
Joined: 27-February 07
From: Perth, Western Australia
Member No.: 2,049



Thanks to both of you; I think Darin was right, it was the "mish-mash" of coding that was causing probs (I'm new to coding!) Works and validates ok now. Well done.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 12:33 AM