Jump to content

Recommended Posts

Posted

Hello,

 

I have wrote a PHP script that writes a sitemap so that it can be dynamically updated when a user changes the website layout. Below is the xml structure that i cannot see any problems with but i cannot get it validated.

 

The error that comes up is:

 

Content of element type "root" must match "(url)".

 

 

Here is the xml code,

 

]>

http://whatever.co.uk/

http://whatever.co.uk/about/

http://whatever.co.uk/contact/

http://whatever.co.uk/services/

http://whatever.co.uk/

http://whatever.co.uk/

http://whatever.co.uk/test3/

http://whatever.co.uk/

http://whatever.co.uk/my-name/

http://whatever.co.uk/test5/

 

Can anyone help me here?

 

Thanks a lot everyone.

 

Eddie

Posted

Not messed around with dtd's but I'll bet that removing the (URL) bit will fix it...

 

Other things to try:

- put the dtd somewhere separately and reference it by urn

- miss out the dtd altogether - your XML looks well-formed and you don't need it

Posted

Lot's of XML but I'm not a DTD person either, however I think(!) that says "root" is an element within "root" which it isn't. If I couldn't find a way to avoid it altogether I'd try this instead:

 

]>

  • Thanks 1
Posted

Thanks very much guys!!

 

Just for anyone that reads this and has this problem, I removed the and that fixed it. Like you said, it was trying to find a 'root' element within the 'root' tags.

 

Thanks again chaps :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...