Re: [Templates] Apache::Template & plugin path problems
[prev]
[thread]
[next]
[Date index for 2004/05/14]
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@xxxxxxxxx.xxx.xxxxxxxxxx.xxx for more info.
--8323328-2089043888-1084539105=:10358
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Thu, 13 May 2004, Kenny Gatdula wrote:
> Try setting the SearchPath for XML::Simple. [% USE xml = XML::Simple(
> 'menu.xml' , {SearchPath => ['/var/www/site/data/'] }) %]
Cool. Amazing what you learn. But I don't like having to specify the
paths in my files, they're different on dev and production. If only
there was a way to infer this automagically...
<fx type="time passes" />
I am pleased to attach a patch that generates a search path list and
passes it to XMLin by introspecting the provider's include path. I freely
admit to cargo culting the introspection line from the archive [1] and I
think it will only work if there's just one provider but it works in my
situation.
It also copes with XML::Simple's idea of what search paths should be (it
doesn't allow relative paths and searchpaths to co-exist) and makes sure
that XMLin sees only a filename and a list of directories.
My itch is scratched. I am happy :-)
Simon.
[1]
http://template-toolkit.org/pipermail/templates/2001-November/002027.html
--
"Hi, I'm crazy Eddie! I put babies on spikes!"
--8323328-2089043888-1084539105=:10358
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xml-simple.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0405141351450.10358@xxxxx.xxxx.xxxxxxxxxxxxxxxx.xxx>
Content-Description:
Content-Disposition: attachment; filename="xml-simple.patch"
LS0tIFNpbXBsZS5vcmlnCTIwMDQtMDUtMTQgMTI6NTg6NTIuMDAwMDAwMDAw
ICswMTAwDQorKysgU2ltcGxlLnBtCTIwMDQtMDUtMTQgMTM6MzY6MzguMDAw
MDAwMDAwICswMTAwDQpAQCAtMjcsNiArMjcsOCBAQA0KIHVzZSBzdHJpY3Q7
DQogdXNlIFRlbXBsYXRlOjpQbHVnaW47DQogdXNlIFhNTDo6U2ltcGxlOw0K
K3VzZSBGaWxlOjpCYXNlbmFtZTsNCit1c2UgRmlsZTo6U3BlYzsNCiANCiB1
c2UgYmFzZSBxdyggVGVtcGxhdGU6OlBsdWdpbiApOw0KIHVzZSB2YXJzIHF3
KCAkVkVSU0lPTiApOw0KQEAgLTQ0LDYgKzQ2LDIwIEBADQogICAgIG15ICRp
bnB1dCAgID0gc2hpZnQ7DQogICAgIG15ICRhcmdzICAgID0gcmVmICRfWy0x
XSBlcSAnSEFTSCcgPyBwb3AoQF8pIDogeyB9Ow0KIA0KKyAgICB1bmxlc3Mg
KCAkaW5wdXQgPX4gLzwvICkgeyAjb25seSBmb3IgZmlsZW5hbWVzDQorICAg
ICAgICBteSAkcGF0aHMgPSAkY29udGV4dC0+eyBMT0FEX1RFTVBMQVRFUyB9
LT5bMF0tPnBhdGhzOw0KKyAgICANCisgICAgICAgIG15ICgkbmFtZSwgJHBh
dGgpID0gZmlsZXBhcnNlKCAkaW5wdXQgKTsNCisgICAgICAgIGlmICgkcGF0
aCkgew0KKyAgICAgICAgICAgIG15IEBkaXJzID0gRmlsZTo6U3BlYy0+c3Bs
aXRkaXIoICRwYXRoICk7DQorICAgICAgICAgICAgbXkgQGZ1bGxkaXJzID0g
bWFwIHsgRmlsZTo6U3BlYy0+Y2F0ZGlyKCAkXywgQGRpcnMgKSB9IEAkcGF0
aHM7DQorICAgICAgICAgICAgJHBhdGhzID0gXEBmdWxsZGlyczsNCisgICAg
ICAgICAgICAkaW5wdXQgPSAkbmFtZTsNCisgICAgICAgIH0NCisgICAgICAg
ICRhcmdzLT57IHNlYXJjaHBhdGggfSA9ICRwYXRoczsNCisNCisgICAgfQ0K
KyAgICANCiAgICAgWE1MaW4oJGlucHV0LCAlJGFyZ3MpOw0KIH0NCiANCg==
--8323328-2089043888-1084539105=:10358--
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates