Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Namespace in XMLDocument

Namespace in XMLDocument

Scheduled Pinned Locked Moved XML / XSL
questioncsharpxmljson
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VSush
    wrote on last edited by
    #1

    Hi, I am sorry if this is a very basic question. I am new to XMLs. I am using .net XMLDocument class to operate with xml files. I would like to know what is the significance of a namespace when parsing XMLs. what and why is a namespace used? Thanks.

    L 1 Reply Last reply
    0
    • V VSush

      Hi, I am sorry if this is a very basic question. I am new to XMLs. I am using .net XMLDocument class to operate with xml files. I would like to know what is the significance of a namespace when parsing XMLs. what and why is a namespace used? Thanks.

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      VSush wrote:

      what and why is a namespace used?

      The base reason for "namespace" support in any code based language is to reduce name collisions. so if you want an xml element named ECustom and so do I we can't use them both in a single document. However if we add a namespace then they become VSush.ECustom and led-mike.ECustom So now they are two different elements and both can be used in a single document without ambiguity.

      led mike

      G 1 Reply Last reply
      0
      • L led mike

        VSush wrote:

        what and why is a namespace used?

        The base reason for "namespace" support in any code based language is to reduce name collisions. so if you want an xml element named ECustom and so do I we can't use them both in a single document. However if we add a namespace then they become VSush.ECustom and led-mike.ECustom So now they are two different elements and both can be used in a single document without ambiguity.

        led mike

        G Offline
        G Offline
        George L Jackson
        wrote on last edited by
        #3

        Adding to led mike's answer, Preventing name collisions is the major reason for using namespaces. Nevertheless, the grouping of names for a specific purpose is a pleasant side-affect of this. Thus, for example, you can have elements that refer to schemas, html, xslt and xml in the same document. George

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups