|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Help needed in namespaces!
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! 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
|
|||||||||

Cart








