Namespace

Namespace or namespace. Way to separate different types of content within a wiki. Groups of similar-purpose pages can be grouped together, one of the proofs of XML’s success is the large number of XML vocabularies (DTDs) that are appearing. Sometimes when making XML documents it is necessary to use several of these vocabularies.

In general, a namespace or namespace is a container that provides the context for the identifiers (names or technical terms, or words) that it possesses, allowing disambiguation of homonymous identifiers that reside in different namespaces.

Summary

[ hide ]

  • 1 Utility
  • 2 Features
  • 3 Objective
  • 4 Discussions of namespaces
  • 5 Sources

Utility

As the number of libraries written in PHP increases, the risk of class and function name collisions between libraries increases. At first it would be totally understandable that different programs implement, for example, a class called Photo that handles the images in the project, but that until the arrival of PHP 5.3 was frowned upon because we had to try to avoid having compatibility problems with other projects.

  • They allow the separation of different types of unrelated content.
  • Some namespaces have special characteristics related to their specific purposes.
  • They provide facilities to limit searches to a particular area.
  • They allow easy export.
  • They enable the separation of different characteristics.

features

  • Namespaces can represent objects and concepts, the namespace of a natural or ethnic language, an artificial language, the technical terminology of a profession, a dialect, a sociolect, or an artificial language (for example, a programming language ).
  • In the Java programming language , identifiers that appear in namespaces have a short (local) name and a single long “qualified” name for use outside the namespace.
  • Some compilers (for languages ​​like C ++) combine namespaces and names in a process called name renaming.

objective

The main purpose of specifying namespaces is to allow the author of the document to tell the parser or parser which DTD to use when parsing a given element. In other words, a label specifies which DTD to use, so this only makes sense if more than one DTD is used . For example, we have an xml sheet with books and another with disks (with their corresponding DTDs) and we want to mix both pages. There will be elements that are not called the same (pages or time), but others that are (title, author). Then both DTDs would be used and we would use the namespaces to distinguish those elements in which it is not clear which DTD they belong to.

Namespace discussions

Except for special pages, each namespace has a discussion namespace associated with it. These discussions are designated by adding Discussion to the usual prefix. For example, the discussion space associated with articles in the main namespace is prefixed with Discussion, while the discussion space associated with the user namespace is prefixed with Discussion User.

Most of the pages located in the namespace discussions are used to discuss changes made to their corresponding pages in their associated namespace. The pages of the “User Discussion” namespace are used to leave messages to specific users, as they will automatically receive a notification of any message left on them.

Leave a Comment

Scroll to Top