[Zope] Re: Adding Custom Namespaces to ZPT?
Wed, 04 Jun 2003 13:53:14 +0200
Evan Simpson schrieb:
> Hartmut Goebel wrote:
> Interesting. ZPT's implementation doesn't have any way of supporting
> this, although one or more of the alternate TAL implementations may be
> more easily extensible.
This is somehow disapointing, since I always tought Zope (and ZPT as
being a part of it) is written to be very extensible.
Can you pint me to some of the alternate ZPT implementations?
> You're essentially trying to make your own mini-language here, and while
No :-) I just want to insert new namespaces beside 'metal:', 'tal:' and
'i18l:. This is not another mini-language, but just using XML to extent
the capabilities of ZPT.
> I won't dispute that this would be useful for you, a generalized version
> of this capability would take a lot of thought. Your best bet may well
> be a quick&dirty hack along the lines of inserting regex-based search
> and replace on your templates before they're compiled. Something along
> the lines of (WARNING: UNTESTED!):
Thanks for the snippet.
This may be a good workaround, but this is not what I wanted. It's
inefficient to regex-replace the string, if it gets parsed just after
this. While this may be practical for a few entities or tags, it get
both slow, inefficient and unmaintainable when implementing some 10 or
even some 100 of tags this way.