Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"XML Parsing Error: junk after document element" error on <body> tag

Tags:

html

css

xml

I am trying to check if my html is a well formed xml as well but I am keep getting this error on the body tag,

XML Parsing Error: junk after document element
Location: location/index.xml
Line Number 10, Column 1:
<body>
^

And here is the code,

<!DOCTYPE html>

<head>
    <meta charset="UTF-8" />
    <title></title>
    <link href="style/style.css" rel="stylesheet" type="text/css"/>
    <link rel="icon" href="images/favicon.ico" />
</head>

<body>
    <main>
        <header>
        </header>

        <nav >

        </nav>
        <article>

        </article>
    </main>

        <div class="push"></div>

        <footer>
        </footer>
</body>
</html>

Whhy am I getting this error ?

like image 709
Riley Willow Avatar asked Apr 09 '15 08:04

Riley Willow


1 Answers

You forgot to start with an html tag. The head element is taken as a root element and there is a junk (body) after this root element (just children, not siblings of root are allowed).

<!DOCTYPE html>
<html> <!-- here -->
    <head>
        <meta charset="UTF-8" />
        <title></title>
        <link href="style/style.css" rel="stylesheet" type="text/css"/>
        <link rel="icon" href="images/favicon.ico" />
    </head>

    <body>
        <main>
        <header>
        </header>

        <nav >

        </nav>
        <article>

        </article>
        </main>

        <div class="push"></div>

        <footer>
        </footer>
    </body>
</html>
like image 66
pavel Avatar answered Nov 15 '22 01:11

pavel