Click to See Complete Forum and Search --> : namespace in xml documents


jigneshjsoni
05-05-2009, 12:23 AM
What does name namespace do in xml document ? I read in the article that, it provides a particular name for a bunch of tags to be used or something like this. I did not understand much in that. Following example is taken from w3school.org

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

In this example, namespace suggest a particular folder or file on www.w3.org
Can we provide any location (any website). What is the specification to declare namespace ? Is there any limit (like server hosting website or particular drive or something else) to declare namespace within ?

I am sure this question is not well constructed, but I am completely confused with this. So please clear some primary idea about namespace and its need.

thanks

felgall
05-05-2009, 10:36 PM
There are a whole range of different types of XML document and sometimes the same tags get used in different types of XML documents to mean different things. The namespaces define which meanings apply to which tags.

For example if you combined XML relating to web pages (such as XHTML) and XML relating to books then both losts of XML will use <title> tags for different purposes and so if both appear in the same document you will need to have the namespaces defined in each so as to distinguish between a web page title and a book title since they both use <title> tags.

mperemsky
05-08-2009, 08:29 AM
What file is actually read from the Transform directory? Is it possible to copy the file from the w2c website and use it locally?

Charles
05-08-2009, 11:30 AM
No file is involved and the namespace doesn't have to point to anything. It's just a unique ID.