It's known that when you have an element like:

    <g:plusone size="medium" href="";></g:plusone>

PHPTAL will throw an error ("There is no namespace declared...")

You can solve this error simply by adding an `xmlns:g` attribute to the
element or one of its ancestores.

However, if you do that, PHPTAL will emit:


and drop the `g`.

This is a problem the script for the Google plus one button will not be
able to find the element since it's looking specifically for `<g:plusone>`
(apparently).  This problem is probably not specific to the plus one button.

My solution is to have something like:

    <tal:block tal:content="structure plusonebutton"/>

And `plusonebutton` in PHP code is the invalid XML `g:plusone` element, but
this is ugly.

Is there any way to have the element directly in the DOM and keep the `g:`
prefix in PHPTAL and still have valid input XML?

Barring that, is there any way to have invalid XML in the input and have
PHPTAL skip parsing it and emit it raw (CDATA is escaped)?

Andrew Crites
Chief of
PHPTAL mailing list

Reply via email to