![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XML Namspaces >Thread Next - Re: XML Namspaces Re: XML NamspacesTo: NULL Date: 5/5/2008 7:23:00 PM Chase Preuninger wrote: > I have I big book on XML, I just never really got the entire thing > about the xmlns. Namespaces are a way of managing XML-based grammars so they can be reliably recognized by applications, and if necessary intermixed in a single document. The xmlns attributes are used to bind prefixes (which are just "syntactic sugar" shorthand) to the namespace names (strings formatted as absolute URI references). Those bindings are scoped, so the same prefix may mean different URIs in different parts of the program. It's also possible to set up a default namespace for elements in one of those parts, just to save a bit of typing. (This sometimes improves readabilty, sometimes makes it worse.) The namespace names are formatted as URI references because "we already know how to manage those so they won't conflict with each other." And that's all there is to that. The namespace name has no other built-in meaning beyond being the name for this namespace. There is no guarantee that there is anything meaningful behind that URI if you try to dereference it, or what you might find there if anything is present. Basically, you shouldn't be trying. (The Semantic Web folks said they would come up with a standard for what a namespace URI might point to. I haven't heard any concrete proposals, and it's been several years. Don't hold your breath.) So namespaces are just an alternative to having to always type a <gawdaful_long_name_that_you_hope_nobody_else_used/>. That really is all there is to them. Most modern XML standards assume you're working with namespaced documents. XML Schema, XPath, XSLT, the Semantic Web stuff, XHTML, XQuery, and so on all assume namespaces are a prerequisite. Read some tutorials and/or re-read that section of the book -- or find another document which explains this better. | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||
|
