• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML Attribute namespace

 
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Assuming the above XML, you can say that the attribute with the value "Davidson" is bound to the "namespace1" namespace. However, saying that the attribute with value "David" is bound to the "namespace" namespace is wrong, no ?

As far as I know local attributes do not belong to any namespace....
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a good question, and one to which I didn't know the answer. So I had a look in the XML Namespaces recommendation, where I found this statement in section 6.2 (Namespace Defaulting):

The namespace name for an unprefixed attribute name always has no value.

And if I'm not mistaken, that means it is not in any namespace.
 
Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly. That is also what I was thinking after reading the spec and some other online resources. However, I got this from a certification mock question from SCDJWS. The answer stated that the value "David" is bound the namespace "namespace". So I guess the answer is wrong then.

I hope SUN knows the correct answer when I take the exam:)

Thanks.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic