Hi Damjan,
Am 11.09.2007 um 16:30 schrieb Damjan:
> Is there any difference between
> <py:match path="head"
once="true">
> <head py:attrs="select(' *')">
>
> and
> <head py:match="head"
once="true" py:attrs="select(' *')">
Definitely. In the first snippet, you're using py:match as
an
element. The once="true" attribute belongs to the
py:match element,
and gets used by the match directive as an optimization hint
(although only in current trunk, and the upcoming 0.5
release; in
0.4.x, the attribute is ignored/discarded)
(see ht
tp://genshi.edgewall.org/wiki/Documentation/xml-
templates.html#match-templates)
In your second snippet, you're using py:match as an
attribute, and
the once="true" attribute belongs to the
<head> element. The match
directive never sees it, and it'll just be passed through
into the
output.
> Also, in order to edit templates ussually one needs
this meta:
> <meta content="text/html; charset=UTF-8"
http-equiv="content-type">
> in both the master layout and individiual templates.
>
> How do I make them not repeat in the final result?
> (Currently I use py:strip="" in individual
templates).
Maybe I'm misunderstanding your question, but
py:replace="''" should
work to remove them, just as py:strip="" should.
Do you want to avoid
putting the directive in all your templates? I'm not sure
the couple
of characters saved is worth it, but you'd need to change
your select
() XPath expressions to be more restrictive.
In general you don't really even need them in the output at
all if
you're setting the actual Content-Type HTTP header
correctly.
Cheers,
Chris
--
Christopher Lenz
cmlenz at gmx.de
http://www.cmlenz.net/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Genshi" group.
To post to this group, send email to genshi googlegroups.com
To unsubscribe from this group, send email to
genshi-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/genshi?hl=en
-~----------~----~----~----~------~----~------~--~---
|