|
|
|
| Each prefix in a qualified name must be associated with a namespace URI.
Namespace URIs do not necessarily refer to an actual, existing document or web
page. They don't even have to use the http protocol, although that is the
most common protocol to use.
Prefixes are bound to namespace URIs by adding an For example: <?xml version="1.0" encoding="utf-8"?> <review:book-review xmlns:review="http://www.book-review.com/"> <author>Harsh K. Critic</author> <date>5 Nov 2006</date> <book>A Brief History of the Twenty-First Century</book> <comments> This book should be read by every American. Blah, blah, blah... </comments> </review:book-review> Another example is the namespace for XHTML: <html xmlns:xhtml="http://www.w3.org/1999/xhtml"> Perhaps the most common place to specify an XML namespace binding is on the root element of an XML document. You can declare multiple XML namespace bindings in a single element. Because such bindings have scope within the element in which they are declared and its contents, the above review prefix is associated with the book-review element and also its child elements. Let's combine the book and review vocabularies to produce the following example:
To see how your browser renders this XML, click here. |
| The page was last updated February 19, 2008 |