top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How can name conflicts be avoided in XML?

0 votes
How can name conflicts be avoided in XML?
posted Jan 2, 2018 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

XML allows the user to create their own tags this can lead to conflicts if an attempt is made to mix two different XML documents from different XML applications. In order to avoid this XML uses the concept of namespaces. Which simply uses a prefix to differentiate between two similarly named tags.

For Example:

<name>Coffee Table</name>

In the above case if both the xml code was to be clubbed together there would be a naming conflict as both the tags of name consists of different content and meaning. In order to avoid this the user simply has to use namespaces.
ie the above code can be re written as:

<b:name>Coffee Table</b:name>

In this way no conflicts occur.

answer Jan 2, 2018 by Shivaranjini