473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

To read the last xmlNode immediately

Hello
I have created a xml doc

Dim xmlDoc As New XmlDocument
xmlDoc.Load(ConfigurationSettings.AppSettings("Reg istrazioneErroriXML"))

The file.xml:

<?xml version="1.0" standalone="yes" ?>
- <NewDataSet>
- <Eccezione>
<ID>1</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuovo eccezione</Messaggio>
</Eccezione>
- <Eccezione>
<ID>2</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuova eccezione catturata</Messaggio>
</Eccezione>
- <Eccezione>
<ID>3</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuova eccezione catturata</Messaggio>
</Eccezione>
- <Eccezione>
<ID>4</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuovo eccezione</Messaggio>
</Eccezione>
</NewDataSet>

How would it be possible to read the last xmlNode immediately ?

es.
xmlNode.Name = ID
xmlNode.Value = 4

Tanks
giuseppe
Nov 11 '05 #1
1 1555
You can use XPath. The following expression

/NewDataSet/Eccezione[last()]/ID

should give you what you want.

-- Dare
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Giuseppe" <NO***********@tin.it> wrote in message
news:%%**********************@news1.tin.it...
Hello
I have created a xml doc

Dim xmlDoc As New XmlDocument
xmlDoc.Load(ConfigurationSettings.AppSettings("Reg istrazioneErroriXML"))

The file.xml:

<?xml version="1.0" standalone="yes" ?>
- <NewDataSet>
- <Eccezione>
<ID>1</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuovo eccezione</Messaggio>
</Eccezione>
- <Eccezione>
<ID>2</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuova eccezione catturata</Messaggio>
</Eccezione>
- <Eccezione>
<ID>3</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuova eccezione catturata</Messaggio>
</Eccezione>
- <Eccezione>
<ID>4</ID>
<Utente>INFORLUAR</Utente>
<Messaggio>Nuovo eccezione</Messaggio>
</Eccezione>
</NewDataSet>

How would it be possible to read the last xmlNode immediately ?

es.
xmlNode.Name = ID
xmlNode.Value = 4

Tanks
giuseppe

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Paul M | last post by:
hi there, i have an xml file, but am not too sure how to read all these elements using vb.net code. any help would be greatly appreciated:)) <---------CODE---------------> <?xml...
3
by: Mahesh Devjibhai Dhola | last post by:
Hi All, I want to make a custom class in c#, which extends System.Xml.XmlNode class of BCL. Now in custom class, I have implement abstract methods of XmlNode class also. Now when I am trying to...
7
by: SQLScott | last post by:
I have a Web Service in which I am trying to pass an XMLDocument as a parameter to one of the methods. I would like to use the XMLTextReader to read the XML but I am getting the following error: ...
5
by: Mahesh Devjibhai Dhola | last post by:
Hi All, I want to make a custom class in c#, which extends System.Xml.XmlNode class of BCL. Now in custom class, I have implement abstract methods of XmlNode class also. Now when I am trying to...
35
by: RyanS09 | last post by:
Hello- I am trying to write a snippet which will open a text file with an integer on each line. I would like to read the last integer in the file. I am currently using: file = fopen("f.txt",...
1
by: Jeff Ditty | last post by:
Hello- I am looking for the best way to run different Xpath expressions from a web service, and return the appropriate XML data. The data source that the web service queries is an XML file,...
4
by: Gerrit | last post by:
It must be simple, but I don't find how I can read a XmlFile in an ArrayList. Sample of my XmlFile: <?xml version="1.0" encoding="utf-8" ?> <Relations> <Person> <FirstName>John</FirstName>...
6
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem :...
3
anfetienne
by: anfetienne | last post by:
is it possible to change the below code so it reads arrays that php creates and uses it to display the images and captions instead of reading from xml? the purpose of this is because there is not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.