Click here to Skip to main content
15,907,281 members
Home / Discussions / C#
   

C#

 
GeneralRe: Regarding Globalization Pin
Eddy Vluggen13-Oct-09 3:10
professionalEddy Vluggen13-Oct-09 3:10 
QuestionSimulation mobile users in network Pin
trungtin13-Oct-09 0:10
trungtin13-Oct-09 0:10 
QuestionxmlDocument Pin
arkiboys12-Oct-09 23:40
arkiboys12-Oct-09 23:40 
AnswerRe: xmlDocument Pin
SeMartens12-Oct-09 23:55
SeMartens12-Oct-09 23:55 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 0:43
arkiboys13-Oct-09 0:43 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 0:46
SeMartens13-Oct-09 0:46 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 0:51
arkiboys13-Oct-09 0:51 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 1:02
SeMartens13-Oct-09 1:02 
Well I will try (without intellisense)...

private void ModifyXML()
{
   XmlDocument doc = new XmlDocument();
   doc.Load(strPath);

    // Retrieve all prices.
    XmlNodeList nodeList = doc.GetElementsByTagName("ElementName");

    foreach (XmlNode node in nodeList)
    {
        string strValue = node.ChildNodes[0].Value.ToString();
        if (strValue.ToLower() == "654322")
        {
            ListBox1.Items.Add(node.OuterXml);
            ListBox1.Items.Add(node.NextSibling.OuterXml);
            ListBox1.Items.Add("");
          
            // create new column node
            XmlNode columnNode = doc.CreateElement("column");
            // create elementName
            XmlNode elementNameNode = doc.CreateElement("elementName");
            // create elementValue
            XmlNode elementValueNode = doc.CreateElement("elementValue");
            // set values
            elementNameNode.InnerText = "foo";
            elementValueNode.InnerText = "bar";
            // append to column node
            columnNode.AppendChild(elementNameNode);
            columnNode.AppendChild(elementValueNode);
            // append column node to current node
            node.ParentNode.AppendChild(columnNode);
 
           

         }
     }
}


It's not a bug, it's a feature!

Check out my CodeProject article Permission-by-aspect.

Me in Softwareland.

GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 1:19
arkiboys13-Oct-09 1:19 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 1:25
SeMartens13-Oct-09 1:25 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 1:29
arkiboys13-Oct-09 1:29 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 1:32
SeMartens13-Oct-09 1:32 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 1:35
arkiboys13-Oct-09 1:35 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 1:38
SeMartens13-Oct-09 1:38 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 1:41
arkiboys13-Oct-09 1:41 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 1:47
SeMartens13-Oct-09 1:47 
GeneralRe: xmlDocument [modified] Pin
arkiboys13-Oct-09 1:59
arkiboys13-Oct-09 1:59 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 2:09
SeMartens13-Oct-09 2:09 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 2:16
arkiboys13-Oct-09 2:16 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 4:23
arkiboys13-Oct-09 4:23 
GeneralRe: xmlDocument Pin
SeMartens13-Oct-09 4:27
SeMartens13-Oct-09 4:27 
GeneralRe: xmlDocument Pin
arkiboys13-Oct-09 5:00
arkiboys13-Oct-09 5:00 
AnswerRe: xmlDocument Pin
Mirko198012-Oct-09 23:56
Mirko198012-Oct-09 23:56 
Questionprinting 2 document to same file/ preview Pin
samy10012-Oct-09 23:39
samy10012-Oct-09 23:39 
AnswerRe: printing 2 document to same file/ preview Pin
Henry Minute13-Oct-09 1:35
Henry Minute13-Oct-09 1:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.