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. C#
  4. XML Heeeelp !

XML Heeeelp !

Scheduled Pinned Locked Moved C#
tutorialxml
2 Posts 2 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.
  • K Offline
    K Offline
    kerberos_prozac
    wrote on last edited by
    #1

    hi, i am facing this trouble (pretty obvious tho') im working with a xmldocument, the trick is this is coming with some empty attributes i want to browse for the empty attributes and to get rid of them this is the example of what do i receive and under is what ive tried it does only displays the name of the empty attribute but do not know how to erase that from the node SO MANY THANKS IN ADVANCE, PEOPLE !!! =========================================================== NOW IS LIKE : example attrib1="" attrib2="yes" attrib3="no" attrib4="" node attribX="" ----------------------------------------------------------- SHOULD BE LIKE : example attrib2="yes" attrib3="no" node =========================================================== XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("nuevo.xml"); XmlNodeList nodes = xmlDoc.SelectNodes("//@*"); foreach(XmlNode node in nodes) { if (node.Value.ToString() == "") { Console.WriteLine(node.Name.ToString()); } } Console.ReadLine();

    N 1 Reply Last reply
    0
    • K kerberos_prozac

      hi, i am facing this trouble (pretty obvious tho') im working with a xmldocument, the trick is this is coming with some empty attributes i want to browse for the empty attributes and to get rid of them this is the example of what do i receive and under is what ive tried it does only displays the name of the empty attribute but do not know how to erase that from the node SO MANY THANKS IN ADVANCE, PEOPLE !!! =========================================================== NOW IS LIKE : example attrib1="" attrib2="yes" attrib3="no" attrib4="" node attribX="" ----------------------------------------------------------- SHOULD BE LIKE : example attrib2="yes" attrib3="no" node =========================================================== XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("nuevo.xml"); XmlNodeList nodes = xmlDoc.SelectNodes("//@*"); foreach(XmlNode node in nodes) { if (node.Value.ToString() == "") { Console.WriteLine(node.Name.ToString()); } } Console.ReadLine();

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      You should check out the MSN documentation, in particular, the XmlNode.Attributes Property[^] which is a collection of the attributes associated to a particular XmlNode.

      - Nick Parker Microsoft MVP - Visual C#
      My Blog | My Articles

      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