Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strings as Commands

0 views
Skip to first unread message

Gordon ALLAN

unread,
Feb 17, 2002, 12:38:49 PM2/17/02
to
I have command
Document.Information.<element>.text

where <element> is a dynamically created string.
Document is of type Variant but becomes a DOM object for an XML file

How can I cast this string into the command so that, for instance, if
<element> was 'mickey' then I could make the command say

document.information.mickey.text:= 'mouse'

Any thoughts?

Thanks for now

Gordon ALLAN
gor...@allanhome.net

Maarten Wiltink

unread,
Feb 17, 2002, 1:13:37 PM2/17/02
to
Gordon ALLAN wrote in message ...

>I have command
>Document.Information.<element>.text
>
>where <element> is a dynamically created string.
>Document is of type Variant but becomes a DOM object for an XML file
>
>How can I cast this string into the command so that, for instance, if
><element> was 'mickey' then I could make the command say
>
>document.information.mickey.text:= 'mouse'


document.information.getElementsByTagName('mickey'),
which would give you a nodelist, from which you could
conceivably extract the text by further coding.

When you say DOM, people might just expect it to work
the way the World Wide Web Consortium says it should.

Does this have any bearing on Delphi?

Groetjes,
Maarten Wiltink

Gordon ALLAN

unread,
Feb 17, 2002, 1:38:28 PM2/17/02
to
This doesn't really work unfortiunately.

I am just using the following code to create the variant

Document := CoDOMDocument.Create;
Document.load('c:\info.xml');

I then can reference to each individual element and then text item as
follows/

document.elementname.subelement.text:='mouse';

I need to be able to manually create this subelement to be created
from 2 variables.

if I simply enter the command as document.elementname.var1+var2.text:=
mouse;

I end up with a subelement called var1+var2

Any oothe thoughts? The components I am using come from
http://www.cogisoft.fr/downloads

Thanks for now

Gordon ALLAN
gor...@allanhome.net

Gordon ALLAN

unread,
Feb 17, 2002, 1:47:15 PM2/17/02
to
I don;t think that the url I included is the same product. I got it
from Trry at http://www.torry.net/vcl/system/ole/xmlauto.zip

Sorry about that

Gordon ALLAN

0 new messages