Using MarkupTemplate to generate parts of an HTML page

29 views
Skip to first unread message

Samuel

unread,
Dec 30, 2006, 9:02:38 AM12/30/06
to Genshi
Hi,

I am using the following MarkupTemplate:

----------
<b py:if="foo">${bar}</b>
----------

and get the following error message:
----------
unbound prefix: line 1, column 0, in login_form.tmpl
----------

This is of course correct, because according to the documentation
Genshi checks whether the "py" namespace was declared.

However, I am trying to use MarkupTemplate to generate HTML snippets,
not a complete web page, so I can not declare the namespace within the
template. Is there a way to generate from XML even if the namespace is
not declared?

-Samuel

Shannon -jj Behrens

unread,
Jan 2, 2007, 9:23:46 PM1/2/07
to gen...@googlegroups.com

The following is an HTML snippet. Because the <html> tag has
py:strip="", it gets stripped out:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude"
py:strip="">

<p id="indexLink" style="text-align: right">
[<a href="/">List of Messages</a>]
</p>

<h1>Welcome to Seamstress Exchange!</h1>

<p class="action-results"
py:if="c.action_results"
py:content="c.action_results">
</p>

</html>

Happy Hacking!
-jj

--
http://jjinux.blogspot.com/

Reply all
Reply to author
Forward
0 new messages