> That defeats my purpose of having the actual code being ignorant
> of the XML
> format. Also, with lots of variables to replace, this would get tedious to
> write and slow to process.
Not sure I follow that logic. How many variables are we talking about: 100,
300, 3000. Even at 3000 this would be doable if one used routines (macros or
even another mivascript) for actually writing the glosub parsing: Paste base
string with variable place holder, replace placeholder with real variable
and some other charater added as to represent the token, etc....
While performance wouldn't be lightning fast with 3000 glosubs, it would be
acceptable in most cases.
> I think this must be doable - as an example, Ivo's mail modules can take
> MivaScript in their headers/footers. And his modules process that "dynamic
> code". Perhaps he's saving to a file and then relying on Vladdy to execute
> that file... Not sure if it would be that complicated or not?
I do believe he is using his vladdy parser on this which might be the way to
go if runtime performance was an issue.
-Bruce
> Susan Petracco
> [email protected]
> NetBlazon
> E-Business for Every Business
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Patrick Locke
> > Sent: Tuesday, January 18, 2005 12:34 PM
> > To: [email protected]
> > Subject: Re: [meu] Executing dynamic code
> > Importance: High
> >
> > A token should work for this.
> >
> > I.E. The value in the DB would be:
> > <?xml version="1.0"?><ECommerce action="Request"
> > version="1.1"><Requestor><ID>###$$$###</ID></Requestor><Transa
> > ctionTrace>Gil
> > ligan Rate Request</TransactionTrace></Shipment></ECommerce>'
> >
> > Then Call it like this.
> > <MvASSIGN NAME="xml_message" VALUE="{
> > glosub(MyDatabase.d.format,'###$$$###', airgolidd )}">
> >
> >
> > Patrick
> >
> > ----- Original Message -----
> > From: "Susan Petracco" <[email protected]>
> > To: "'Bill Gilligan'" <[email protected]>; <[email protected]>
> > Sent: Tuesday, January 18, 2005 6:59 AM
> > Subject: RE: [meu] Executing dynamic code
> >
> >
> > > Ok, let me backup - after looking at your example I see
> > that I explained
> > > this incorrectly. (It was late when I posted last night!)
> > What I'd like to
> > > do, is store the message format in a database. So (to use
> > your example)
> > the
> > > database would contain the literal:
> > >
> > > '<?xml version="1.0"?><ECommerce action="Request"
> > > version="1.1"><Requestor><ID>' $ airgolidd $
> > > '</ID></Requestor><TransactionTrace>Gilligan Rate
> > > Request</TransactionTrace></Shipment></ECommerce>'
> > >
> > > I then assign that to a variable:
> > >
> > > <MvASSIGN NAME="xml_message" VALUE="{ MyDatabase.d.format }">
> > >
> > > So xml_message contains the unparsed literal string...it
> > hasn't filled in
> > > "airgolidd" with the value of the variable called "airgolidd".
> > >
> > > I then need to parse the string, substituting the variable
> > name for the
> > > value of that variable, before I pass it via MvCALL.
> > >
> > > (FWIW, I want to do this so the code isn't hardcoded to a
> > specific message
> > > format.)
> > >
> > > Susan Petracco
> > > [email protected]
> > > NetBlazon
> > > E-Business for Every Business
> > >
> > > > -----Original Message-----
> > > > From: [email protected]
> > > > [mailto:[email protected]] On Behalf Of Bill Gilligan
> > > > Sent: Monday, January 17, 2005 11:43 PM
> > > > To: Susan Petracco; [email protected]
> > > > Subject: RE: [meu] Executing dynamic code
> > > > Importance: High
> > > >
> > > > Susan,
> > > > here is some example code (slightly edited).
> > > > ==================================
> > > > <MvAssign name="airtest" value="{ '<?xml version="1.0"?><ECommerce
> > > > action="Request" version="1.1"><Requestor><ID>' $ airgolidd $
> > > > '</ID></Requestor><TransactionTrace>Gilligan Rate
> > > > Request</TransactionTrace></Shipment></ECommerce>'}">
> > > >
> > > > <MvCALL ACTION =
> > > > "https://ecommerce.airborne.com/ApiLanding.asp" METHOD =
> > > > "XML" FIELDS = "airtest">
> > > > ======================================
> > > >
> > > > Works like a charm!
> > > >
> > > > Bill
> > > >
> > > > -----Original Message-----
> > > > From: [email protected]
> > [mailto:[email protected]]On
> > > > Behalf Of Susan Petracco
> > > > Sent: Monday, January 17, 2005 9:40 PM
> > > > To: [email protected]
> > > > Subject: [meu] Executing dynamic code
> > > >
> > > >
> > > > Seems like I should know this, but don't...and the only
> > > > references I seem to
> > > > find are for executing a dynamic function call.
> > > >
> > > > Anyway, I have a variable that has a MivaScript snippet to
> > > > define an xml
> > > > message. Something like this:
> > > >
> > > > <MvASSIGN NAME="l.xml" VALUE="{ '<firstname>' $ l.firstname $
> > > > '</firstname>'
> > > > }">
> > > >
> > > > I want to parse that code for passing to a script via MvCALL,
> > > > so that I'm
> > > > actually passing
> > > > <firstname>Susan</firstname>
> > > > When l.firstname is Susan.
> > > >
> > > > This is doable, right? How?
> > > >
> > > > Thanks,
> > > > Susan
> > > >
> > > > Susan Petracco
> > > > [email protected]
> > > > NetBlazon
> > > > E-Business for Every Business
> > > >
> > > >
> > > >
Comment