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. Visual Basic
  4. To remove xmlns value from Xml file

To remove xmlns value from Xml file

Scheduled Pinned Locked Moved Visual Basic
xmlhelptutorial
4 Posts 4 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.
  • S Offline
    S Offline
    Sam M
    wrote on last edited by
    #1

    Hi there, Through coding i'm creating a xml file. In this manually i'm creating some node eg: "". Now what's happening is, it's automatically creating xmlns value as: "". But i don't want that. Please help me. How to remove xmlns value. I don't want that. Regards n Thks Sam.M

    D R 2 Replies Last reply
    0
    • S Sam M

      Hi there, Through coding i'm creating a xml file. In this manually i'm creating some node eg: "". Now what's happening is, it's automatically creating xmlns value as: "". But i don't want that. Please help me. How to remove xmlns value. I don't want that. Regards n Thks Sam.M

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Well, that would depend entirely on how you're generating this XML file. Without seeing the code, it's impossible to tell you how to do it.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      1 Reply Last reply
      0
      • S Sam M

        Hi there, Through coding i'm creating a xml file. In this manually i'm creating some node eg: "". Now what's happening is, it's automatically creating xmlns value as: "". But i don't want that. Please help me. How to remove xmlns value. I don't want that. Regards n Thks Sam.M

        R Offline
        R Offline
        richardw48
        wrote on last edited by
        #3

        In vb.net I use the following: Dim ns As New XmlSerializerNamespaces ns.Add("", "") 'empty strings required to prevent default namespace declarations appearing in xml file

        A 1 Reply Last reply
        0
        • R richardw48

          In vb.net I use the following: Dim ns As New XmlSerializerNamespaces ns.Add("", "") 'empty strings required to prevent default namespace declarations appearing in xml file

          A Offline
          A Offline
          ALI_SHAH
          wrote on last edited by
          #4

          Hi All, I saw various option in this thrade and come to solve my own solution for remove xmlns attribute in xml. This is working properly and no any issue with this---> 'Remove the Equifax / Transunian / Experian root node attribute that have xmlns and load xml without xmlns attributes. If objXMLDom.DocumentElement.NamespaceURI <> String.Empty Then objXMLDom.LoadXml(objXMLDom.OuterXml.Replace(objXMLDom.DocumentElement.NamespaceURI, "")) objXMLDom.DocumentElement.RemoveAllAttributes() ResponseXML = objXMLDom.OuterXml End If Therefor no need to do any thing else to remove xmlns from xml :thumbsup:

          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