PinkTurtle
PinkTurtle

Reputation: 7041

Error at XML validation

I am new to xml, so if someone could point me out to what is wrong here I would bevery glad.

I am basically trying to validate a xml document in the form

<?xml version="1.1" encoding="UTF-8"?>

<tag1>foo</tag1>
<tag2>bar</tag2>
<tree>
    <moreStuffBelow></moreStuffBelow>
    <!-- // -->
</tree>

and am getting these error messages from the W3C validator :

Errors found while checking this document as XML!
document type does not allow element "tag2" here
document type does not allow element "tree" here

Thank you

Upvotes: 1

Views: 243

Answers (2)

obe6
obe6

Reputation: 1881

Each XML must have one single root element. In your case there isn't a root element.

Root Element

Upvotes: 2

Mike Christensen
Mike Christensen

Reputation: 91598

All XML needs one and only one root element:

<Something>
   <tag1>1</tag1>
   <tag2>Cipret</tag2>
   <tree>
       <moreStuffBelow></moreStuffBelow>
       <!-- // -->
   </tree>
</Something>

Upvotes: 1

Related Questions