Ajith, Consider this from the Namespace link provided by you....
<foo:A xmlns:foo="http://www.foo.org/"> <B foo:C="foo" D="bar"/> </foo:A> The element type name A and the attribute name C are in the http://www.foo.org/ namespace because they are mapped there by the foo prefix. The element type name B and the attribute name D are not in any XML namespace because no prefix maps them there. On the other hand, the elements A and B and the attributes C and D are not in any XML namespace, even though they are physically within the scope of the http://www.foo.org/ namespace declaration. This is because XML namespaces contain names, not elements or attributes.
I am a bit confused here. Could you kindly explain the comment in bold. If everything within the scope of namespace declaration is only name then why is 'B' being referred to as element B.
"Eager Beaver", The name you have chosen is acceptable for use in the "Meaningless Drivel" forum, but we have a naming convention for our main forums, described at http://www.javaranch.com/name.jsp . We strongly recommend that you use your full real name. Please log in with a new name which meets the requirements. Thanks.
I don't blame you. It is indeed confusing. Let me try.. XML namespaces contain names, not elements or attributes. Any qualified name that has a colon prefix belongs to a namespace. The identifier immediately preceding the colon is the name of the namespace. It is important not to get confused between names, elements and attributes. Every element has a name and an optional attribute list. The word "element" refers to everything that lies between the < and />, including the name. An element name on the otherhand is just an identifier that uniquely identifies one or more elements within a context.
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Joined: Feb 26, 2001
Frank, Sorry for using the nick. I shall be careful not to use it the next time.
Ajith, Kindly consider the following in quotes.... posted by Eager
On the other hand, the elements A and B and the attributes C and D are not in any XML namespace
Any qualified name that has a colon prefix belongs to a namespace
Is there a subtle difference between the phrases 'in a XML namespace' and 'belonging to a XML namespace'. If not then attribute C which has been aptly qualified as foo:C should belong to the namespace. thanks & regards, Rajendra.