Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Namespace Error in XML Sitemap

7:28 am on Jan 16, 2012 (gmt 0)

New User

5+ Year Member

joined:Jan 16, 2012
posts: 1
votes: 0


Please explain me the namespace error in XML sitemaps.
I read but not able to understand.
why this occur, how to resolve this and everything related to it.

2:16 pm on Jan 16, 2012 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 29, 2003
votes: 0

namespaces are used to define the schema for a node, and they aren't as intuitive as the rest of XML syntax. It all has to do with validation. If it weren't for the need to validate XML according to a schema (DTD), then namespaces wouldn't be needed.

Say you have a schema which uses XML to describe a book. A book has <author>, <isbn>, <pages>, <title>, etc. In XML you can define a namespace for those nodes, so their context is understood. These nodes belong in the namespace of "book".

But you might have another namespace which describes the nodes of a person. <gender>, <firstname>, <age>, <height>, etc. Those nodes belong in the namespace of "person".

So let's say you want to use both of them in the same document. To to that, you'll end up prefixing your nodes with the namespace, like this:

<book:title>How to Use Namespaces</book:title>

All HTML pages are namespaced, but you normally can't tell because the default namespace for an HTML document is "html". And the default can be omitted. So we're allowed to use <p>, <b>, <blockquote>... when the syntactically full expression is <html:p>, <html:p>, <html:blockquote>.

The "xmlns" attribute of an XML node lets you define that default, with a link to its DTD:

<html xmlns='http://www.w3.org/1999/xhtml'>
<head><title>Hello World</title></head>...

Namespaces make XML more complicated. Why do they exist?
It's so documents can be validated, when there may be nodes with the same name that have different meanings. For example:



Each of these namespaces have a different meaning for <pack>, so perhaps a <cards:pack> may contain a <cards:card>, while a <wolves:pack> can contain a <wolves:wolf>

this guide will show you how it works...


If you're getting an error regarding namespaces, you likely need to either 1) define your namespace with an "xmlns" attribute (often in the root node), or 2) prefix your elements with that namespace.