Im trying to update a value in an xml file. Ive had no success so far. Im trying to follow the MSDN guide but im unable to update the value.
Sub save2(ByVal xmlFilePath As String)
Try
'load document
Dim movieData = Xdocument.Load(xmlFilePath)
'get position and set value
For Each movie In From element In movieData.<movies>.<movie>
movie.<name>.Value = "TEST VALUE"
Next
Catch ex As Exception
End Try
End Sub
my xml data
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<opensearch:Query searchTerms="44833"/>
<opensearch:totalResults>1</opensearch:totalResults>
<movies>
<movie>
<popularity>211195.458</popularity>
<translated>true</translated>
<adult>false</adult>
<language>en</language>
<original_name>Battleship</original_name>
<name>Battleship</name>
<alternative_name>Battleship, el desafío</alternative_name>
<type>movie</type>
<id>44833</id>
<imdb_id>tt1440129</imdb_id>
Before i resorted to creating a new xml file but as my project has grown this is not adaquate
any help would be great.
kevin

New Topic/Question
Reply



MultiQuote




|