[ZPT] CVS: Packages/TAL - TALGenerator.py:1.31
guido@digicool.com
guido@digicool.com
Mon, 9 Apr 2001 18:53:16 -0400 (EDT)
Update of /cvs-repository/Packages/TAL
In directory korak:/tmp/cvs-serv1024
Modified Files:
TALGenerator.py
Log Message:
When optimizing startEndTag, use " />" as the end separator when
generating HTML, and "/>" for XML, instead of always using "/>".
This is necessary for proper XHTML generation.
--- Updated File TALGenerator.py in package Packages/TAL --
--- TALGenerator.py 2001/04/06 00:59:45 1.30
+++ TALGenerator.py 2001/04/09 22:53:15 1.31
@@ -118,6 +118,10 @@
output = []
collect = []
rawseen = cursor = 0
+ if self.xml:
+ endsep = "/>"
+ else:
+ endsep = " />"
for cursor in xrange(len(program)+1):
try:
item = program[cursor]
@@ -133,7 +137,7 @@
if self.optimizeStartTag(collect, item[1], item[2], ">"):
continue
if item[0] == "startEndTag":
- if self.optimizeStartTag(collect, item[1], item[2], "/>"):
+ if self.optimizeStartTag(collect, item[1], item[2], endsep):
continue
text = string.join(collect, "")
if text: