Re: Generating executable code
| From: | Tijnema | Date: | Mon, 13 Aug 2007 13:32:34 +0000 |
| Subject: | Re: Generating executable code | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260766@lists.php.net to get a copy of this message | ||
On 8/13/07, Chris Boget <chris.boget@wild.net> wrote:
> Currently, I have an XML file that I load in, parse manually and iterate
> through the nodes to create objects, etc, using the node values as
> parameters. This works all well and fine but is a little resource
> intensive.
>
> Now, I can create a XSL template to transform the XML file and output
> all the PHP code that we are doing manually. However, when the
> transformation occurs, the result is pretty much just a string as far as
> PHP is concerned; it isn't executable PHP code.
>
> I know I can output the result to a temporary file then include it or I
> can pass the result to eval() to execute the code, but neither is ideal.
> Is there another way I can do what I need? Is there a way to 'include'
> (for the lack of a better term) the result of the XSL transformation
> such that PHP processes it as it would any other source code?
>
> thnx,
> Chris
>
Well, that's exactly what eval does, why isn't it ideal for you?
Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info