Re: Dynamic includes...

Chris Croome <chris-u/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <[email protected]>
Hi

On Sun 12-Dec-2004 at 02:07:10PM -0500, Josh Narins wrote:
> 
>    I would like to do dynamic includes like this...
> 
>    $template->process({ extra_content => '/other.xml'})
> 
>    And have the file referred to by "extra_content" in the href
>    attribute of this this template:
> 
>    <xi:include href="" /> 
> 
>    or this file attribute of this one...
>    <?include file=""?>
> 
>    But I can't seem to get either to work.

I can't help with the Perl code you need, but FWIW both the include
syntaxes you have been trying are old hacks and the best way to do this
is using macros, these take a bit of getting used to but they are a lot
more powerful, they are documented here:

  http://search.cpan.org/~jhiver/Petal-2.14/lib/Petal.pm#METAL_MACROS

Chris  

-- 
Chris Croome                               <chris-u/[email protected]>
web design                             http://www.webarchitects.co.uk/ 
web content management                               http://mkdoc.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.