Last post Apr 17, 2015 09:20 AM by sudip_inn
Apr 16, 2015 05:33 AM|sudip_inn|LINK
without namespace we can construct xml file with data so then when namespace is required in xml. please help me to understand the importance of namespace in xml with example and xml code. thanks
Apr 16, 2015 05:48 AM|Lokesh B R|LINK
XML Namespaces provide a method to avoid element name conflicts.
See the detailed example here
Apr 16, 2015 05:48 AM|mshoaiblibra|LINK
Read below artical in detail for more information:
Apr 16, 2015 06:53 AM|sudip_inn|LINK
i do not like to follow any link for this issue rather i want some one discuss here the advantage of namespace in xml and when it is used to avoid which kind of conflict. come with example here.
Apr 16, 2015 06:55 AM|Lokesh B R|LINK
Just spend few minutes on the link and you will understand the concept with the example there.
Apr 16, 2015 10:20 AM|Siva Krishna Macha|LINK
Yes basically if there are multiple entities with same name but they are really different - then we can use namespace prefixes to solve the problem. So, to resolve conflicts - we can use xml namespaces.
Think that, you are developing a system and you have defined an entity called User.
You would need to send the entity called User to the back end system (Say a component called CRM) as well.
Essentially, if as per your logic, you want to embed both your User entity and CRM related User entity in the same xml. How would you going to tell the xml to understand which User entity it is?
Here is where namespace comes to picture.
Apr 17, 2015 01:44 AM|Zhi Lv - MSFT|LINK
As for this issue, the namespace is used to resolve the ambiguity between identically named elements or attributes. Fro more details, please refer to
XML namespaces are used for providing uniquely named
elements and attributes in an
XML document. They are defined in a
An XML instance may contain element or attribute names from more than one XML vocabulary. If each vocabulary is given a
namespace, the ambiguity between identically named elements or attributes can be resolved.
A simple example would be to consider an XML instance that contained references to a customer and an ordered product. Both the customer element and the product element could have a child element named
id. References to the id element would therefore be ambiguous; placing them in different namespaces would remove the ambiguity.
Apr 17, 2015 03:39 AM|sudip_inn|LINK
thanks for answer. can u plzz give me a complete sample xml with namespace used for customer and product so i can visualize how they should look like?
Apr 17, 2015 04:57 AM|Siva Krishna Macha|LINK
You can see there is name element and ID element in both of the entities. So, we can identity whether the particular element is of Product's or Customer's.
Apr 17, 2015 09:20 AM|sudip_inn|LINK
thanks for your xml. just i got a xml with namespace used in it
xmlns:d=http://schemas.microsoft.com/ado/2007/08/dataservices … >