Declaring Namespaces

Namespaces are declared in XML documents using a namespace declaration, which takes the following form:

xmlns:Prefix="NameSpace"

The xmlns keyword is what alerts an XML processor that a namespace is being declared. The Prefix part of the namespace declaration allows you to set a prefix that will serve as a shorthand reference for the namespace throughout the scope of the element in which the namespace is declared. The Prefix of a namespace is optional and ultimately depends on whether you want to use qualified or unqualified element and attribute names throughout a document. A qualified name includes the Prefix portion of the namespace declaration and consists of two parts: the prefix and the local portion of the name. ...

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.