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

RE: Help needed in namespaces!

  • To: "'Satish S'" <satish.s@h...>, <xml-dev@l...>
  • Subject: RE: Help needed in namespaces!
  • From: "Doug Schepers" <doug@s...>
  • Date: Thu, 29 Sep 2005 04:09:11 -0400
  • In-reply-to: <20050928102528.3CB3913D999@s...>
  • Thread-index: AcXEFdjgf07crY6RTWOaebOdXvNDygAtLUAw

furnitureml
Hi, Sathish-
 
| Can any one tell me what the meaning of namespaces in XML and its use. 
 
The basic idea really easier than you might think. The metaphor I use is
that namespaces are the family name of an element or an attribute. You might
know 2 people named Joe, one at the office and one in your neighborhood.
Normally, it doesn't really matter what their family name is... The people
in the office know who you mean when you say, "Joe," and the people in your
neighborhood know who you mean when you talk about the other. But when you
are speaking to someone who knows both Joes, you have to clarify if you mean
"Joe Kramer" or "Joe Yu." In a document with only one namespace, there's
less need to specify which family (XML dialect) an element or attribute
belongs to, but when you mix elements or attributes from 2 different
families (dialects), you need to specify which ones belong to which family
(or dialect, or namespace). Since it's increasingly likely these days that
you will have mixed-namespace documents (also called Compound Documents),
it's a safe bet to always include all the namespaces used in the root of the
document.

A simple example might be a document with both HTML and FurnitureML, where
both of them have a <table> element. You would need to say <html:table .../>
or <furniture:table .../> to tell the UA (the browser) which one you mean.

Note that if the attributes of an element are in the same namespace as that
element, you do not need to preface them with the 'mynamespace:' prefix;
otherwise, you do.

I hope that's simple enough for you, and isn't too egregiously erroneous
that I offend someone else. ;)

Regards-
Doug

doug . schepers  @ vectoreal.com
www.vectoreal.com ...for scalable solutions.




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.