Discussion:
"Verbatim" option
seletz
2008-12-01 10:47:54 UTC
Permalink
Hi,
using plone trunk and the chameleon buildout, I found that Plone
breaks when trying to add a new ``Page`` because of KUPU.

I found that rendering the ``drawer.xsl`` breaks using chameleon,
because they clash with chameleon's $-interpolation (they **do**
use TAL in other places in this file, so it needs to be rendered by
chameleon)::

<xsl:template match="resource|collection" mode="image-view">
<xsl:variable name="p" select="preview"></xsl:variable>
<xsl:choose>
<xsl:when test="media='flash'">
<object src="{$p}" data="{$p}" type="application/x-
shockwave-flash"
width="100" height="100">
<param name="movie" value="{$p}" />
</object>
</xsl:when>

I talked to malthe, and I'd like to implement a ``verbatim`` option,
used like this::

<xsl:template match="resource|collection" mode="image-view"
tal:verbatim="">
<xsl:variable name="p" select="preview"></xsl:variable>
<xsl:choose>
<xsl:when test="media='flash'">
<object src="{$p}" data="{$p}" type="application/x-
shockwave-flash"
width="100" height="100">
<param name="movie" value="{$p}" />
</object>
</xsl:when>

This would cause chameleon to output that node and it's children
verbatim, not interpreting them.

Any thoughts?

Stefan.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Wichert Akkerman
2008-12-01 11:16:09 UTC
Permalink
Post by seletz
Hi,
using plone trunk and the chameleon buildout, I found that Plone
breaks when trying to add a new ``Page`` because of KUPU.
I found that rendering the ``drawer.xsl`` breaks using chameleon,
because they clash with chameleon's $-interpolation (they **do**
use TAL in other places in this file, so it needs to be rendered by
Why does chameleon do $-expansion in zpt? That's a Genshi feature.
Post by seletz
I talked to malthe, and I'd like to implement a ``verbatim`` option,
<xsl:template match="resource|collection" mode="image-view"
tal:verbatim="">
<xsl:variable name="p" select="preview"></xsl:variable>
<xsl:choose>
<xsl:when test="media='flash'">
<object src="{$p}" data="{$p}" type="application/x-
shockwave-flash"
width="100" height="100">
<param name="movie" value="{$p}" />
</object>
</xsl:when>
This would cause chameleon to output that node and it's children
verbatim, not interpreting them.
Any thoughts?
-1

fixing an incompatibility by adding an extra option does not feel like
the right approach. It's similar to how IE8 is adding a 'really follow
standards' flag: evil.

Wichert.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Malthe Borch
2008-12-01 11:56:23 UTC
Permalink
Post by Wichert Akkerman
Why does chameleon do $-expansion in zpt? That's a Genshi feature.
Yes, it's a Genshi-feature, but it's been present in ``chameleon.zpt``
for a long time now.

I would not necessarily be opposed to disabling/removing it for
z3c.pt, but it's very convenient for ``chameleon.zpt``.

I do admit that it's a bit confusing that Chameleon would have the
$-operator whereas ZPT wouldn't. But I think it's a matter of
documentation.

\malthe

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Wichert Akkerman
2008-12-01 12:31:32 UTC
Permalink
Post by Malthe Borch
Post by Wichert Akkerman
Why does chameleon do $-expansion in zpt? That's a Genshi feature.
Yes, it's a Genshi-feature, but it's been present in ``chameleon.zpt``
for a long time now.
I would not necessarily be opposed to disabling/removing it for
z3c.pt, but it's very convenient for ``chameleon.zpt``.
That sounds like a sensible approach. I don't think it can be enabled in
z3c.pt/five.pt since they should be fully compatible with stock TAL.

Wichert.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Stefan Eletzhofer
2008-12-02 13:45:10 UTC
Permalink
Hi,
Post by Wichert Akkerman
Post by Malthe Borch
Post by Wichert Akkerman
Why does chameleon do $-expansion in zpt? That's a Genshi feature.
Yes, it's a Genshi-feature, but it's been present in
``chameleon.zpt``
for a long time now.
I would not necessarily be opposed to disabling/removing it for
z3c.pt, but it's very convenient for ``chameleon.zpt``.
That sounds like a sensible approach. I don't think it can be
enabled in z3c.pt/five.pt since they should be fully compatible with
stock TAL.
I've just committed the relevant changes on ``z3c.pt`` trunk. I've
changed ``chameleon.zpt`` to allow the interpolation be switched on or
off using ``meta:interpolation="true|false"``.

For ``chameleon.zpt`` this defaults to ``true``, and for ``z3c.pt`` this
defaults to ``false``.

I'm now testing this on plone-trunk, where it failed originally.

Stefan.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---

Malthe Borch
2008-12-01 12:22:13 UTC
Permalink
Post by seletz
I found that rendering the ``drawer.xsl`` breaks using chameleon,
because they clash with chameleon's $-interpolation (they **do**
use TAL in other places in this file, so it needs to be rendered by
An alternative solution to this problem would be to require curly
braces in ``chameleon.zpt``:

e.g. ${name}, not $name.

Currently, both forms are supported (like Genshi).

\malthe

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Paul Everitt
2008-12-01 12:24:19 UTC
Permalink
Post by Malthe Borch
Post by seletz
I found that rendering the ``drawer.xsl`` breaks using chameleon,
because they clash with chameleon's $-interpolation (they **do**
use TAL in other places in this file, so it needs to be rendered by
An alternative solution to this problem would be to require curly
e.g. ${name}, not $name.
Currently, both forms are supported (like Genshi).
FWIW, I didn't even realize the non-curly form was supported by ZPT.

--Paul
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Paul Everitt
2008-12-01 12:22:56 UTC
Permalink
If it matters, we (which most likely means, me) could rewrite the XSLT
to not use the attribute-value-template syntax, and instead use the
more verbose "<xsl:attribute>" syntax. This would get rid of dollar
signs in the XSLT.

--Paul
Post by seletz
Hi,
using plone trunk and the chameleon buildout, I found that Plone
breaks when trying to add a new ``Page`` because of KUPU.
I found that rendering the ``drawer.xsl`` breaks using chameleon,
because they clash with chameleon's $-interpolation (they **do**
use TAL in other places in this file, so it needs to be rendered by
<xsl:template match="resource|collection" mode="image-view">
<xsl:variable name="p" select="preview"></xsl:variable>
<xsl:choose>
<xsl:when test="media='flash'">
<object src="{$p}" data="{$p}" type="application/x-
shockwave-flash"
width="100" height="100">
<param name="movie" value="{$p}" />
</object>
</xsl:when>
I talked to malthe, and I'd like to implement a ``verbatim`` option,
<xsl:template match="resource|collection" mode="image-view"
tal:verbatim="">
<xsl:variable name="p" select="preview"></xsl:variable>
<xsl:choose>
<xsl:when test="media='flash'">
<object src="{$p}" data="{$p}" type="application/x-
shockwave-flash"
width="100" height="100">
<param name="movie" value="{$p}" />
</object>
</xsl:when>
This would cause chameleon to output that node and it's children
verbatim, not interpreting them.
Any thoughts?
Stefan.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "z3c.pt" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to z3c_pt+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/z3c_pt?hl=en
-~----------~----~----~----~------~----~------~--~---
Loading...