Set new value to Xml document : XElement « XML LINQ « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » XML LINQ » XElementScreenshots 
Set new value to Xml document
  

Imports System
Imports System.Reflection
Imports System.Xml

Module Module1

    Sub Main()
        Dim xdoc As XDocument = XDocument.Load("data.xml")

        xdoc.Element("PLAY").Element("PERSONA").SetValue("new value")

        Console.WriteLine(xdoc.Element("PLAY").Element("PERSONA").Value)
    End Sub

End Module

   
    
  
Related examples in the same category
1.Build an XElement from string
2.Create a single XML element
3.After elements
4.Adding XElement to XElement
5.Before elements
6.Create an in-memory XML document
7.First name element has attributes
8.First name tag has child elements
9.FirstLast Or Default Example
10.First Last Example
11.FirstName tag's parent has child elements
12.Get first descendant
13.Load the Employees.xml and store the contents into an XElement object.
14.Remove content from XElement
15.Remove from XElement
16.Replace content from XElement
17.Update attribute for XElement
18.Update XElement
19.Using Xml Linq to output Html
20.using XElement.Parse to load Xml from String
21.Xml Literal with string variable
22.Xml literal with function return
23.Enumerate over the array to build an XElement
24.Add 5 new green Fords to the incoming document
25.Add the new node to the bottom of the XML tree
26.Create a query to convert the xml data into fields delimited by quotes and commas.
27.Convert comma separated value to Xml
28.Get child elements by name directly
29.Get value of each color using indexer
30.Is FirstName tag empty?
31.Is idperson tag empty?
32.Remove the 4th Employee element.
33.Using Ling query to create Xml output
34.The Root property returns the top-level XElement
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.