[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Global/Local attributes
>But it isn't just syntactic minimization. Named namespaces and default >namespaces are not they same. The default namespace isn't *unnamed*. The name of a namespace is its namespace URI. A default namespace is just one that you're using without a prefix in this document. > They have different semantics. Using the default namespace mechanism to refer to a namespace does not change the semantics of that namespace. The only difference is that there's one thing you can't do with no-prefix that you can do with a prefix, viz put an attribute in the namespace. Just to be absolutely clear, given: <bar xmlns="http://example.org" xmlns:foo="http://example.org" foo:att="1"> The element bar and the attribute foo:att are in the same namespace, which happens to be the default namespace. There aren't two namespaces that could have different semantics, there's only one. There are two different *syntaxes*. If you're taking an old document - or set of documents - and giving it a namespace, you can usually choose not to require the attributes to be in a namespace, so using no prefix will be fine. To re-iterate what's been said several times before: whether <foo:bar att="123"> and <foo:bar foo:att="123"> are equivalent (and whether either is illegal) is a matter for the application. It's something you as an author have to *choose* when converting a non-namespaced vocabulary to use namespaces. If you choose to allow or require namespaced attributes, you won't be able to use the default namespace exclusively. -- Richard
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|