PDA

View Full Version : How to update xml file using VB.NET??



nanana_81
Dec 9th, 2005, 08:03 AM
Hi guys ..

I'm just the beginner, now i've got some problem in my task. I'm also using the newscroller Javascript as same as the above

I want to update my XML file (News.xml) using VB.NET code behind. I have managed to create XML like this :-



<NewDataSet>
<Item>
<Text> testing one </Text>
</Item>
</NewDataSet>


.. and from this XML file, I want to load it into the newscroller Javascript.
The problem is, the Javascript code just can load XML data field like below only --->



<xml id="xmlNews">
<Items>
<Item>
<Text> testing two </Text>
</Item>
<Items>
</xml>



and if i update the XML file, it will store 'outside' of the <xml id="xmlNews'>.



<NewDataSet>

<xml id="xmlNews">
<Items>
<Item>
<Text> testing two </Text>
</Item>
<Items>
</xml>

<Item>
<Text> testing one </Text>
</Item>
</NewDataSet>


..as the result, the newscroller Javascript will not load the updated values (testing one) above.

can somebody help me please ..?
if you guys do not follow the problems, later i will post the VB.Net Code creating the dataset of the XML..

thank you .

robertsams23
Dec 23rd, 2008, 04:28 AM
Check with the follwoing link

http://vb.net-informations.com/xml/vb.net-xml-tutorial.htm

robert.

SouthwaterDave
Dec 27th, 2008, 12:34 PM
The simple answer is: Don't write
<NewDataSet>
<Item>
<Text> testing one </Text>
</Item>
</NewDataSet> to News.xml. Write this instead:
<xml id="xmlNews">
<Items>
<Item>
<Text> testing two </Text>
</Item>
<Items>
</xml> If you post your code I could show you what needs to be changed, if necessary.

Robert, I looked through the tutorials behind the link you supplied. The website had some useful VB.NET/XML stuff but I didn't find anything close enough to be the answer to the original question asked.