[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Global/Local attributes


Re:  Global/Local attributes
> Since we are all getting confused and since we are proposing a change in the
> way that certain attributes are handled when namespaces are involved, how
> abou this...  Suppose the following XML:
> 
> <elem1 xmlns="http://example.com/ns1" xmlns:x="http://example.com/ns2">
>     <x:elem2 x:attr1="" attr2="" />
>     <elem3 attr3="" />
> </elem1>
> 
> In the above, we know the following to be true according to the current rec:
> 
> elem1 belongs to the default namespace ("http://example.com/ns1").
> elem2 belongs to the "x" namespace (="http://example.com/ns2").
> attr1 belongs to the "x" namespace.
> attr2 belongs to no namespace at all.
> elem3 belongs to the default namespace.
> attr3  belongs to... default namespace or no namespace?  ("Note that default
> namespaces do not apply directly to attributes." [1])
> 
> According to the rec, I would have to say that "attr3" belongs to no
> namespace.
> 
> Now, I hear what Simon has been saying.  And I know (I think) that he is
> mostly talking about the instance where you could have something like:
> 
> <elem1 xmlns="http://example.com/ns1" xmlns:x="http://example.com/ns2">
>     <x:elem2 x:attr="" attr="" />
> </elem1>
> 
> However, I would think that in the case above that "attr2" should belong to
> the default namespace, not the namespace that "elem2" belongs to.  The
> reason for this is that there is no other way to use attributes defined in
> the default namespace.  If you want, you could have a fall-back rule that
> says a non-prefixed attribute would belong to no namespace if a default
> namespace is not defined.  However, I think a rule like that would would
> reduce readability and be more error-prone.

Please, no.  I think that placing unprefixed attributes in the default 
namespace would be *far* worse than what we have now.  Now would it address 
the concerns motivating proposals for change in the namespaces REC.


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Track chair, XML/Web Services One Boston: http://www.xmlconference.com/
Basic XML and RDF techniques for knowledge management, Part 7 - 
http://www-106.ibm.com/developerworks/xml/library/x-think12.html
Keeping pace with James Clark - http://www-106.ibm.com/developerworks/xml/libra
ry/x-jclark.html
Python and XML development using 4Suite, Part 3: 4RDF - 
http://www-105.ibm.com/developerworks/education.nsf/xml-onlinecourse-bytitle/8A
1EA5A2CF4621C386256BBB006F4CEC



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.