XML Heeeeelp !

  • Thread starter rene.rugerio[at]gmail.com
  • Start date
R

rene.rugerio[at]gmail.com

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();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top