reading a xml value from text box

D

deepak

Hi All,

On a asp.net web page, i have a text box and a button ('Submit') , the text
box has below contents


<SXPTaskUpdateOrAdd Revision="7.5.0" Source="India_Bharti">
<Task>
<NOCRefID>SH123456</NOCRefID>
<TaskType>Corrective</TaskType>
<EarlyStart>2006-02-03T00:00:00</EarlyStart >
<DesiredDueDate>2006-02-05T00:00:00</DesiredDueDate >
<NumberOfRequiredEngineers>1</NumberOfRequiredEngineers>
<AutoCreate>true</AutoCreate>
</Task>
</SXPTaskUpdateOrAdd>


in my VB.NET code(ASP.NET), i want to read value of EarlyStart during
pageload event i.e. here it is 2006-02-03T00:00:00 inside <EarlyStart > tag.


How can i read it?Kindly Guide me please


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

LVP

1- You can load into XML DOM
2- RegExp
or
3 If you have this

string tt =
>"; // TextBox.Text;

int startTagPos = tt.IndexOf("<EarlyStart>");

int endTagPos = tt.IndexOf("</EarlyStart>");

int EarlyStartLen = endTagPos - startTagPos - 12;

string EarlyStart = tt.Substring(startTagPos + 12, endTagPos - startTagPos -
12);

Also I notice you have an extra space in </EarlyStart > "t >"

LVP
 
D

deepak

may u tell me through vb.net code please as its hard for me to understand urs
points properly.? Also that extra space is by mistake.in actual there is no
space...kindy tell me by code step by step...i would be greateful.....
 
D

deepak

Also this webpage (having textbox is demo) for us.in actualy production
environment,we will get this SXP message through http protocol so consider
that scenario plz and tell me
 
L

LVP

1- You can load into XML DOM, could be overkill
2- RegExp
or
3 If you have this

Dim tt as string = DemoYourTextBoxID.Text

Dim startTagPos as integer = tt.IndexOf("<EarlyStart>")

Dim endTagPos as integer = tt.IndexOf("</EarlyStart>");

Dim EarlyStartLen as integer = endTagPos - startTagPos - 12;

Dim EarlyStart as string = tt.Substring(startTagPos + 12, EarlyStartLen);


LVP
 
D

deepak

Hi LVP,
the question is that how to get this xml as there is no textbox in real
production environment and this xml message will come through internet via
http protocol.
tHIS PAGE dont play any role in actual production environment and this is
just asumption that we r goign to process the message of production (present
in this text box) through this page but in actual the same xmlmessage
willcome through http protocol... then how to get the xml message through
request object like request.form.getvalues(...).....Kinldy tell me i would be
highly helped by this?
 

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

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,228
Latest member
MikeMichal

Latest Threads

Top