Reading a xml element

D

deepak

Hi All

i have a xmlelement saying in_root which has outer and inner xml as shown
below:

OuterXml
"<SXPTaskUpdateOrAdd Revision=" 7.5.0 "
Source="ER_Kista"><Task><NOCRefID>Deepak_0208_1</NOCRefID><Customer>KPN-NL</Customer><Title>The
work order
title</Title><Priority>1</Priority><Status>Unassigned</Status><NewComment>last
comment only</NewComment><ContactName>Fredrik
Viberg</ContactName><ContactPhoneNumber>+46 730 51 38
96</ContactPhoneNumber><EstimatedDuration>36000</EstimatedDuration><EarlyStart>2006-02-03T00:00:00</EarlyStart><DesiredDueDate>2006-02-05T00:00:00</DesiredDueDate></Task></SXPTaskUpdateOrAdd>"


InnerXml

"<Task><NOCRefID>Deepak_0208_1</NOCRefID><Customer>KPN-NL</Customer><Title>The
work order
title</Title><Priority>1</Priority><Status>Unassigned</Status><NewComment>last
comment only</NewComment><ContactName>Fredrik
Viberg</ContactName><ContactPhoneNumber>+46 730 51 38
96</ContactPhoneNumber><EstimatedDuration>36000</EstimatedDuration><EarlyStart>2006-02-03T00:00:00</EarlyStart><DesiredDueDate>2006-02-05T00:00:00</DesiredDueDate></Task>"


i want to check through vb.net code tha t if this in_root has node
<EarlyStart> or not? similar checkfor <DesiredDueDate> also,,,how can i check
it ....

Kinldy tell me ..
i tried some of following ways but its giving me nothing in quick watch

xnodeDesiredDueDate = in_root.Item("DesiredDueDate")
xnodeEarlyStartDate = in_root.Item("EarlyStart")

xnodeDesiredDueDate =
in_root.SelectSingleNode("SXPTaskUpdateOrAdd/Task/DesiredDueDate")

xnodeEarlyStartDate =
in_root.SelectSingleNode("SXPTaskUpdateOrAdd/Task/EarlyStart")


Any help asap would be grealty helpful for me...

Thanks,
Deepak
(e-mail address removed)
(e-mail address removed)
 
D

deepak

k i got it using
Dim element As XmlElement = in_root.Item("Task")
xnodeDesiredDueDate = element.Item("DesiredDueDate")

xnodeEarlyStartDate = element.Item("EarlyStart")

thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top