Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2005, 03:39 AM
912219 912219 is offline
Junior Member
 
Join Date: May 2005
Posts: 14
Default Searching for a xml node.

I have a xml document and each node contains an attribute named 'Name'.I want to make a procedure that searches for a text in the name and saves the result in a tmemo or something.For example if cnode.Attributes['Name'] ='something',and i am searching for 'met', 'something' should be added to the tmemo.
I want to do this in a thread and im not sure how to use txmldocument in a thread,but that is not the main question.
Reply With Quote
  #2  
Old 05-26-2005, 04:37 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Searching for a xml node.

This is just a fragment of the code...but hopefully enough to get my point accross

I need to fix my two readonly properties (Days & Day)

Can anyone tell me why they dont work (Im having a brain fart!)

UnSysAPps


TMyEvent = class(TObject)
private
fEventDate: TDateTime;
fEndDate: TDateTime;
fDays: Integer; //****
fDay: String; //****
procedure SetEventDate(Value: TDateTime);
procedure SetEndDate(Value: TDateTime);
function GetDays: Integer;
function GetDay: String;
public
property EventDate: TDateTime read fEventDate write SetEventDate;
property EndDate: TDateTime read fEndDate write SetEndDate;
property Days: Integer read GetDays; //****
property Day: String read GetDay; //****
end;



function TMyEvent.GetDays: Integer;
begin
if DateOf(fEventDate) > DateOf(Date) then
result:= DaysBetween(DateOf(fEventDate), DateOf(Date))
else
result:= - DaysBetween(DateOf(fEventDate), DateOf(Date));
//fDays:= result;
end;

function TMyEvent.GetDay: String;
begin
case DayOf(fEventDate) of
1: result:= 'Sunday';
2: result:= 'Monday';
3: result:= 'Tuesday';
4: result:= 'Wednesday';
5: result:= 'Thursday';
6: result:= 'Friday';
7: result:= 'Saturday';
end;
//fDay:= Result;
end;
Reply With Quote
  #3  
Old 05-26-2005, 04:37 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Searching for a xml node.

Sorry posted in wrong spot!

UnSysApps
Reply With Quote
  #4  
Old 05-27-2005, 06:55 AM
MrBaseball34 MrBaseball34 is offline
Senior Member
 
Join Date: Jan 2001
Posts: 7,260
Default RE: Searching for a xml node.

So how are you opening the XMLDocument? What DOM are you
using?

MrBaseball34
Hook'Em Horns!
Reply With Quote
  #5  
Old 05-27-2005, 08:28 AM
912219 912219 is offline
Junior Member
 
Join Date: May 2005
Posts: 14
Default RE: Searching for a xml node.

I solved the problem.The problem was, you are not supose to use tXmlDocument in a thread,you must use iXmlDocument.
Thanks for the reply.
Reply With Quote
  #6  
Old 06-06-2005, 08:48 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Searching for a xml node.

Was your question answered?

If this helps, please accept as answer!

UnSysApps
Reply With Quote
  #7  
Old 06-06-2005, 10:03 AM
912219 912219 is offline
Junior Member
 
Join Date: May 2005
Posts: 14
Default RE: Searching for a xml node.

I have solved the problem myself.
Reply With Quote
  #8  
Old 06-06-2005, 11:14 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Searching for a xml node.

Thank you, please post the solution for others (in the future)



If this helps, please accept as answer!

UnSysApps
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:07 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.