[Zope3-checkins] SVN: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/ checkpoint: move to a single output mode

Fred L. Drake, Jr. fdrake at gmail.com
Fri Oct 14 17:19:40 EDT 2005


Log message for revision 39456:
  checkpoint: move to a single output mode
  WARNING:  lots of tests fail!
  

Changed:
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/pagetemplate/pagetemplate.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/driver.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/htmltalparser.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/taldefs.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talgenerator.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talinterpreter.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talparser.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test01.xml
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test02.xml
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test04.xml
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test10.html
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test12.html
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test16.xml
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.html
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.xml
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test24.html
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test25.html
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test_failed_attr_translation.html
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_htmltalparser.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_sourcepos.py
  U   Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_talinterpreter.py

-=-
Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/pagetemplate/pagetemplate.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/pagetemplate/pagetemplate.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/pagetemplate/pagetemplate.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -185,6 +185,7 @@
         """
         engine = self.pt_getEngine()
         source_file = self.pt_source_file()
+        gen = TALGenerator(engine, source_file=source_file)
         if self.content_type == 'text/html':
             # Deprecation warnings that should have sense until Zope 3.4
             from warnings import warn
@@ -194,10 +195,8 @@
                  "located there %s." % self.pt_source_file(),
                  DeprecationWarning)
             # EOF deprecation
-            gen = TALGenerator(engine, xml=0, source_file=source_file)
             parser = HTMLTALParser(gen)
         else:
-            gen = TALGenerator(engine, source_file=source_file)
             parser = TALParser(gen)
 
         self._v_errors = ()

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/driver.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/driver.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/driver.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -192,12 +192,13 @@
     if filename.startswith(prefix):
         filename = filename[len(prefix):]
     filename = filename.replace(os.sep, '/') # test files expect slashes
+    generator = TALGenerator(source_file=filename)
     if mode == "html":
         from zope.tal.htmltalparser import HTMLTALParser
-        p = HTMLTALParser(gen=TALGenerator(source_file=filename, xml=0))
+        p = HTMLTALParser(gen=generator)
     else:
         from zope.tal.talparser import TALParser
-        p = TALParser(gen=TALGenerator(source_file=filename))
+        p = TALParser(gen=generator)
     p.parseFile(file)
     return p.getCode()
 

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/htmltalparser.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/htmltalparser.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/htmltalparser.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -18,6 +18,7 @@
 
 from HTMLParser import HTMLParser, HTMLParseError
 
+from zope.tal import taldefs
 from zope.tal.taldefs import ZOPE_METAL_NS, ZOPE_TAL_NS, ZOPE_I18N_NS, \
                              METALError, TALError, I18NError
 from zope.tal.talgenerator import TALGenerator
@@ -108,7 +109,7 @@
     def __init__(self, gen=None):
         HTMLParser.__init__(self)
         if gen is None:
-            gen = TALGenerator(xml=0)
+            gen = TALGenerator()
         self.gen = gen
         self.tagstack = []
         self.nsstack = []
@@ -158,27 +159,30 @@
                 attrlist.remove(type_attr[0])
                 taldict = {'script': type_attr[0][1], 'omit-tag': ''}
         self.tagstack.append(tag)
+        ending = tag in EMPTY_HTML_TAGS
         self.gen.emitStartElement(tag, attrlist, taldict, metaldict, i18ndict,
-                                  self.getpos())
-        if tag in EMPTY_HTML_TAGS:
-            self.implied_endtag(tag, -1)
+                                  self.getpos(), isend=ending)
+        if ending:
+            self.tagstack.pop()
+            self.pop_xmlns()
 
     def handle_startendtag(self, tag, attrs):
         self.close_para_tags(tag)
         self.scan_xmlns(attrs)
         tag, attrlist, taldict, metaldict, i18ndict \
              = self.process_ns(tag, attrs)
+        pos = self.getpos()
         if taldict.get("content"):
             if tag in EMPTY_HTML_TAGS:
                 raise TALError(
                     "empty HTML tags cannot use tal:content: %s" % `tag`,
-                    self.getpos())
+                    pos)
             self.gen.emitStartElement(tag, attrlist, taldict, metaldict,
-                                      i18ndict, self.getpos())
-            self.gen.emitEndElement(tag, implied=-1, position=self.getpos())
+                                      i18ndict, pos)
+            self.gen.emitEndElement(tag, implied=-1, position=pos)
         else:
             self.gen.emitStartElement(tag, attrlist, taldict, metaldict,
-                                      i18ndict, self.getpos(), isend=1)
+                                      i18ndict, pos, isend=1)
         self.pop_xmlns()
 
     def handle_endtag(self, tag):
@@ -324,4 +328,11 @@
             attrlist.append(item)
         if namens in ('metal', 'tal'):
             taldict['tal tag'] = namens
+        if "attributes" in taldict:
+            taldict["attributes"] = taldefs.parseAttributeReplacements(
+                taldict["attributes"], xml=False)
+        i18nattrs = taldefs.parseI18nAttributes(
+            i18ndict.get("attributes"), self.getpos(), xml=False)
+        if i18nattrs:
+            i18ndict["attributes"] = i18nattrs
         return name, attrlist, taldict, metaldict, i18ndict

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/taldefs.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/taldefs.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/taldefs.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -116,6 +116,10 @@
 _subst_re = re.compile(r"\s*(?:(text|structure)\s+)?(.*)\Z", re.S)
 
 def parseAttributeReplacements(arg, xml):
+    if arg:
+        arg = arg.strip()
+    if not arg:
+        return None
     dict = {}
     for part in splitParts(arg):
         m = _attr_re.match(part)
@@ -129,6 +133,36 @@
         dict[name] = expr
     return dict
 
+def parseI18nAttributes(i18nattrs, position, xml):
+    if i18nattrs:
+        i18nattrs = i18nattrs.strip()
+    if not i18nattrs:
+        return None
+    d = {}
+    # Filter out empty items, eg:
+    # i18n:attributes="value msgid; name msgid2;"
+    # would result in 3 items where the last one is empty
+    attrs = [spec for spec in i18nattrs.split(";") if spec]
+    for spec in attrs:
+        parts = spec.split()
+        if len(parts) == 2:
+            attr, msgid = parts
+        elif len(parts) == 1:
+            attr = parts[0]
+            msgid = None
+        else:
+            raise TALError("illegal i18n:attributes specification: %r" % spec,
+                           position)
+        if not xml:
+            attr = attr.lower()
+        if attr in d:
+            raise TALError(
+                "attribute may only be specified once in i18n:attributes: %r"
+                % attr,
+                position)
+        d[attr] = msgid
+    return d
+
 def parseSubstitution(arg, position=(None, None)):
     m = _subst_re.match(arg)
     if not m:

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talgenerator.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talgenerator.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talgenerator.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -33,7 +33,7 @@
     inMacroDef = 0
     source_file = None
 
-    def __init__(self, expressionCompiler=None, xml=1, source_file=None):
+    def __init__(self, expressionCompiler=None, source_file=None):
         if not expressionCompiler:
             from zope.tal.dummyengine import DummyEngine
             expressionCompiler = DummyEngine()
@@ -53,9 +53,7 @@
         # {slot-name --> default content program}
         self.slots = {}
         self.slotStack = []
-        self.xml = xml  # true --> XML, false --> HTML
         self.emit("version", TAL_VERSION)
-        self.emit("mode", xml and "xml" or "html")
         if source_file is not None:
             self.source_file = source_file
             self.emit("setSourceFile", source_file)
@@ -87,8 +85,7 @@
                 if self.optimizeStartTag(collect, item[1], item[2], ">"):
                     continue
             if opcode == "startEndTag":
-                endsep = self.xml and "/>" or " />"
-                if self.optimizeStartTag(collect, item[1], item[2], endsep):
+                if self.optimizeStartTag(collect, item[1], item[2], " />"):
                     continue
             if opcode in ("beginScope", "endScope"):
                 # Push *Scope instructions in front of any text instructions;
@@ -232,16 +229,12 @@
         self.emit(opcode, name, attrlist)
 
     def emitEndTag(self, name):
-        if self.xml and self.program and self.program[-1][0] == "startTag":
-            # Minimize empty element
-            self.program[-1] = ("startEndTag",) + self.program[-1][1:]
-        else:
-            self.emit("endTag", name)
+        self.emit("endTag", name)
 
     def emitOptTag(self, name, optTag, isend):
         program = self.popProgram() #block
         start = self.popProgram() #start tag
-        if (isend or not program) and self.xml:
+        if isend or not program:
             # Minimize empty element
             start[-1] = ("startEndTag",) + start[-1][1:]
             isend = 1
@@ -515,11 +508,11 @@
         repeat = taldict.get("repeat")
         content = taldict.get("content")
         script = taldict.get("script")
-        attrsubst = taldict.get("attributes")
+        repldict = taldict.get("attributes", {})
         onError = taldict.get("on-error")
         omitTag = taldict.get("omit-tag")
         TALtag = taldict.get("tal tag")
-        i18nattrs = i18ndict.get("attributes")
+        i18nattrs = i18ndict.get("attributes", {})
         # Preserve empty string if implicit msgids are used.  We'll generate
         # code with the msgid='' and calculate the right implicit msgid during
         # interpretation phase.
@@ -585,7 +578,6 @@
             if defineMacro:
                 self.pushProgram()
                 self.emit("version", TAL_VERSION)
-                self.emit("mode", self.xml and "xml" or "html")
                 # generate a source annotation at the beginning of the macro
                 if self.source_file is not None:
                     if position != (None, None):
@@ -670,17 +662,7 @@
         if optTag:
             todo["optional tag"] = omitTag, TALtag
             self.pushProgram()
-        if attrsubst or i18nattrs:
-            if attrsubst:
-                repldict = taldefs.parseAttributeReplacements(attrsubst,
-                                                              self.xml)
-            else:
-                repldict = {}
-            if i18nattrs:
-                i18nattrs = _parseI18nAttributes(i18nattrs, self.position,
-                                                 self.xml)
-            else:
-                i18nattrs = {}
+        if repldict or i18nattrs:
             # Convert repldict's name-->expr mapping to a
             # name-->(compiled_expr, translate) mapping
             for key, value in repldict.items():
@@ -819,32 +801,6 @@
                 self.emit("setSourceFile", self.source_file)
 
 
-def _parseI18nAttributes(i18nattrs, position, xml):
-    d = {}
-    # Filter out empty items, eg:
-    # i18n:attributes="value msgid; name msgid2;"
-    # would result in 3 items where the last one is empty
-    attrs = [spec for spec in i18nattrs.split(";") if spec]
-    for spec in attrs:
-        parts = spec.split()
-        if len(parts) == 2:
-            attr, msgid = parts
-        elif len(parts) == 1:
-            attr = parts[0]
-            msgid = None
-        else:
-            raise TALError("illegal i18n:attributes specification: %r" % spec,
-                           position)
-        if not xml:
-            attr = attr.lower()
-        if attr in d:
-            raise TALError(
-                "attribute may only be specified once in i18n:attributes: %r"
-                % attr,
-                position)
-        d[attr] = msgid
-    return d
-
 def test():
     t = TALGenerator()
     t.pushProgram()

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talinterpreter.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talinterpreter.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talinterpreter.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -40,18 +40,6 @@
 # Avoid constructing this tuple over and over
 I18nMessageTypes = (MessageID, Message)
 
-# TODO: In Python 2.4 we can use frozenset() instead of dict.fromkeys()
-BOOLEAN_HTML_ATTRS = dict.fromkeys([
-    # List of Boolean attributes in HTML that should be rendered in
-    # minimized form (e.g. <img ismap> rather than <img ismap="">)
-    # From http://www.w3.org/TR/xhtml1/#guidelines (C.10)
-    # TODO: The problem with this is that this is not valid XML and
-    # can't be parsed back!
-    "compact", "nowrap", "ismap", "declare", "noshade", "checked",
-    "disabled", "readonly", "multiple", "selected", "noresize",
-    "defer"
-])
-
 _nulljoin = ''.join
 _spacejoin = ' '.join
 
@@ -64,10 +52,10 @@
 
 class AltTALGenerator(TALGenerator):
 
-    def __init__(self, repldict, expressionCompiler=None, xml=0):
+    def __init__(self, repldict, expressionCompiler=None):
         self.repldict = repldict
         self.enabled = 1
-        TALGenerator.__init__(self, expressionCompiler, xml)
+        TALGenerator.__init__(self, expressionCompiler)
 
     def enable(self, enabled):
         self.enabled = enabled
@@ -82,7 +70,7 @@
         taldict = {}
         i18ndict = {}
         if self.enabled and self.repldict:
-            taldict["attributes"] = "x x"
+            taldict["attributes"] = {"x": "x"}
         TALGenerator.emitStartElement(self, name, attrlist,
                                       taldict, metaldict, i18ndict,
                                       position, isend)
@@ -206,9 +194,6 @@
         self.showtal = showtal
         self.strictinsert = strictinsert
         self.stackLimit = stackLimit
-        self.html = 0
-        self.endsep = "/>"
-        self.endlen = len(self.endsep)
         # macroStack entries are MacroStackItem instances;
         # the entries are mutated while on the stack
         self.macroStack = []
@@ -356,16 +341,6 @@
         assert version == TAL_VERSION
     bytecode_handlers["version"] = do_version
 
-    def do_mode(self, mode):
-        assert mode in ("html", "xml")
-        self.html = (mode == "html")
-        if self.html:
-            self.endsep = " />"
-        else:
-            self.endsep = "/>"
-        self.endlen = len(self.endsep)
-    bytecode_handlers["mode"] = do_mode
-
     def do_setSourceFile(self, source_file):
         self.sourceFile = source_file
         self.engine.setSourceFile(source_file)
@@ -381,11 +356,11 @@
     bytecode_handlers["setPosition"] = do_setPosition
 
     def do_startEndTag(self, stuff):
-        self.do_startTag(stuff, self.endsep, self.endlen)
+        self.do_startTag(stuff, " />")
     bytecode_handlers["startEndTag"] = do_startEndTag
 
     def do_startTag(self, (name, attrList),
-                    end=">", endlen=1, _len=len):
+                    end=">", _len=len):
         # The bytecode generator does not cause calls to this method
         # for start tags with no attributes; those are optimized down
         # to rawtext events.  Hence, there is no special "fast path"
@@ -426,7 +401,7 @@
                         col = col + 1 + slen
                     append(s)
             append(end)
-            col = col + endlen
+            col = col + _len(end)
         finally:
             self._stream_write(_nulljoin(L))
             self.col = col
@@ -477,16 +452,7 @@
         name, value, action = item[:3]
         ok = 1
         expr, xlat, msgid = item[3:]
-        if self.html and name.lower() in BOOLEAN_HTML_ATTRS:
-            evalue = self.engine.evaluateBoolean(item[3])
-            if evalue is self.Default:
-                if action == 'insert': # Cancelled insert
-                    ok = 0
-            elif evalue:
-                value = None
-            else:
-                ok = 0
-        elif expr is not None:
+        if expr is not None:
             evalue = self.engine.evaluateText(item[3])
             if evalue is self.Default:
                 if action == 'insert': # Cancelled insert
@@ -674,10 +640,13 @@
                     self.interpret(program)
                 finally:
                     self.popStream()
-                if self.html and self._currentTag == "pre":
-                    value = tmpstream.getvalue()
-                else:
-                    value = normalize(tmpstream.getvalue())
+                # NOTE: This used to check for HTML-mode output and
+                # currentTag=="pre", and avoided normalizing
+                # whitespace in the message ID in that case.  We might
+                # consider adding xml:space to allow this in the
+                # future, but the old difference between HTML and
+                # XHTML seems like a bug anyway.
+                value = normalize(tmpstream.getvalue())
             finally:
                 self.restoreState(state)
         else:
@@ -739,10 +708,13 @@
         # the top of the i18nStack.
         default = tmpstream.getvalue()
         if not msgid:
-            if self.html and currentTag == "pre":
-                msgid = default
-            else:
-                msgid = normalize(default)
+            # NOTE: This used to check for HTML-mode output and
+            # currentTag=="pre", and avoided normalizing whitespace in
+            # the message ID in that case.  We might consider adding
+            # xml:space to allow this in the future, but the old
+            # difference between HTML and XHTML seems like a bug
+            # anyway.
+            msgid = normalize(default)
         self.i18nStack.pop()
         # See if there is was an i18n:data for msgid
         if len(stuff) > 2:
@@ -774,10 +746,7 @@
             # Take a shortcut, no error checking
             self.stream_write(text)
             return
-        if self.html:
-            self.insertHTMLStructure(text, repldict)
-        else:
-            self.insertXMLStructure(text, repldict)
+        self.insertXMLStructure(text, repldict)
 
     def do_insertI18nStructure_tal(self, (expr, repldict, block)):
         # TODO: Code duplication is BAD, we need to fix it later
@@ -795,22 +764,11 @@
             # Take a shortcut, no error checking
             self.stream_write(text)
             return
-        if self.html:
-            self.insertHTMLStructure(text, repldict)
-        else:
-            self.insertXMLStructure(text, repldict)
+        self.insertXMLStructure(text, repldict)
 
-    def insertHTMLStructure(self, text, repldict):
-        from zope.tal.htmltalparser import HTMLTALParser
-        gen = AltTALGenerator(repldict, self.engine, 0)
-        p = HTMLTALParser(gen) # Raises an exception if text is invalid
-        p.parseString(text)
-        program, macros = p.getCode()
-        self.interpret(program)
-
     def insertXMLStructure(self, text, repldict):
         from zope.tal.talparser import TALParser
-        gen = AltTALGenerator(repldict, self.engine, 0)
+        gen = AltTALGenerator(repldict, self.engine)
         p = TALParser(gen)
         gen.enable(0)
         p.parseFragment('<!DOCTYPE foo PUBLIC "foo" "bar"><foo>')
@@ -884,15 +842,10 @@
         macro = self.engine.evaluateMacro(macroExpr)
         if macro is self.Default:
             macro = block
-        else:
-            if not isCurrentVersion(macro):
-                raise METALError("macro %s has incompatible version %s" %
-                                 (`macroName`, `getProgramVersion(macro)`),
-                                 self.position)
-            mode = getProgramMode(macro)
-            if mode != (self.html and "html" or "xml"):
-                raise METALError("macro %s has incompatible mode %s" %
-                                 (`macroName`, `mode`), self.position)
+        elif not isCurrentVersion(macro):
+            raise METALError("macro %s has incompatible version %s" %
+                             (`macroName`, `getProgramVersion(macro)`),
+                             self.position)
         self.pushMacro(macroName, compiledSlots, definingName, extending)
 
         # We want 'macroname' name to be always available as a variable

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talparser.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talparser.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/talparser.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -15,6 +15,7 @@
 
 $Id$
 """
+from zope.tal import taldefs
 from zope.tal.taldefs import XML_NS, ZOPE_I18N_NS, ZOPE_METAL_NS, ZOPE_TAL_NS
 from zope.tal.talgenerator import TALGenerator
 from zope.tal.xmlparser import XMLParser
@@ -87,6 +88,13 @@
             fixedattrlist.append(item)
         if namens in ('metal', 'tal', 'i18n'):
             taldict['tal tag'] = namens
+        if "attributes" in taldict:
+            taldict["attributes"] = taldefs.parseAttributeReplacements(
+                taldict["attributes"], xml=True)
+        i18nattrs = taldefs.parseI18nAttributes(
+            i18ndict.get("attributes"), self.getpos(), xml=True)
+        if i18nattrs:
+            i18ndict["attributes"] = i18nattrs
         return name, fixedattrlist, taldict, metaldict, i18ndict
 
     def xmlnsattrs(self):

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test01.xml
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test01.xml	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test01.xml	2005-10-14 21:19:39 UTC (rev 39456)
@@ -54,8 +54,8 @@
     <span></span>
     
 
-    <span/>
-    <span/>
+    <span />
+    <span />
 
     &nbsp;<h3>Header Level 3</h3>
     <span>&nbsp;<h3>Header Level 3</h3></span>

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test02.xml
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test02.xml	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test02.xml	2005-10-14 21:19:39 UTC (rev 39456)
@@ -37,12 +37,12 @@
 		<Country>CANADA</Country>
 	</InvoiceTo>
 	<ShipTo>
-		<Name/>
+		<Name />
 		<AddressLine>ATTN: PAULINE DEGRASSI</AddressLine>		
-		<City/>
-		<PostCode/>
-		<State/>
-		<Country/>
+		<City />
+		<PostCode />
+		<State />
+		<Country />
 	</ShipTo>
 	<DetailLines>
 		<DetailLine>

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test04.xml
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test04.xml	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test04.xml	2005-10-14 21:19:39 UTC (rev 39456)
@@ -6,7 +6,7 @@
     <ul>
     </ul>
 
-    <span/>
+    <span />
 
     <ul>
         <li>
@@ -19,7 +19,7 @@
         </li>
     </ul>
 
-    <span/>
+    <span />
 
     <ul>
         <li>

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test10.html
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test10.html	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test10.html	2005-10-14 21:19:39 UTC (rev 39456)
@@ -10,7 +10,7 @@
     <td><span>
       <h1>Some headline</h1>
       <p>This is the real contents of the bottom right slot.</p>
-      <hr>
+      <hr />
       <p>It is supposed to contain a lot of text.  Blah, blah, blab.
       Blabber, blabber, blah.  Baah, baah, barb.  Blah, blah, blab.
       Blabber, blabber, blah.  Baah, baah, barb.  Blah, blah, blab.
@@ -44,7 +44,7 @@
       Blabber, blabber, blah.  Baah, baah, barb.  Blah, blah, blab.
       Blabber, blabber, blah.  Baah, baah, barb.  Blah, blah, blab.
       Blabber, blabber, blah.  Baah, baah, barb.</p>
-      <br><br>
+      <br /><br />
       </span></td>
   </tr>
 </table>

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test12.html
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test12.html	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test12.html	2005-10-14 21:19:39 UTC (rev 39456)
@@ -1,24 +1,24 @@
 <span />
 
-<img ismap>
-<img ismap="ismap">
-<img ismap="ismap">
-<img ismap="foo">
+<img ismap />
+<img ismap="ismap" />
+<img ismap="ismap" />
+<img ismap="foo" />
 
-<img ismap="ismap">
-<img>
-<img>
+<img ismap="ismap" />
+<img />
+<img />
 
-<img ismap="ismap">
-<img>
-<img>
+<img ismap="ismap" />
+<img />
+<img />
 
-<img ismap="ismap">
-<img>
-<img>
+<img ismap="ismap" />
+<img />
+<img />
 
 <span />
 
-<img src="foo">
-<img src="x.gif">
-<img>
+<img src="foo" />
+<img src="x.gif" />
+<img />

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test16.xml
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test16.xml	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test16.xml	2005-10-14 21:19:39 UTC (rev 39456)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <body>
 
-<ImG href="foo" Alt="bar" alT="baz" Href="about:foo"/>
+<ImG href="foo" Alt="bar" alT="baz" Href="about:foo"></ImG>
 
 </body>

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.html
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.html	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.html	2005-10-14 21:19:39 UTC (rev 39456)
@@ -8,7 +8,7 @@
 
 <p>Content</p>
 <p></p>
-<img>
+<img />
 
 Yes
 Yes

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.xml
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.xml	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test18.xml	2005-10-14 21:19:39 UTC (rev 39456)
@@ -9,8 +9,8 @@
 
 
 <p>Content</p>
-<p/>
-<img/>
+<p />
+<img />
 
 Yes
 Yes

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test24.html
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test24.html	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test24.html	2005-10-14 21:19:39 UTC (rev 39456)
@@ -1,7 +1,7 @@
-<input name="DELETE_BUTTON">
+<input name="DELETE_BUTTON" />
 
-<input name="MESSAGE-ID">
+<input name="MESSAGE-ID" />
 
-<input name="MESSAGE-ID" attr="INPUT-ATTR">
+<input name="MESSAGE-ID" attr="INPUT-ATTR" />
 
-<input name="MESSAGE-ID" attr="INPUT-ATTR">
+<input name="MESSAGE-ID" attr="INPUT-ATTR" />

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test25.html
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test25.html	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test25.html	2005-10-14 21:19:39 UTC (rev 39456)
@@ -1 +1 @@
-<input name="DELETE">
+<input name="DELETE" />

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test_failed_attr_translation.html
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test_failed_attr_translation.html	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/output/test_failed_attr_translation.html	2005-10-14 21:19:39 UTC (rev 39456)
@@ -1 +1 @@
-<input value="don't translate me">
+<input value="don't translate me" />

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_htmltalparser.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_htmltalparser.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_htmltalparser.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -27,7 +27,7 @@
 
     prologue = ""
     epilogue = ""
-    initial_program = [('version', taldefs.TAL_VERSION), ('mode', 'html')]
+    initial_program = [('version', taldefs.TAL_VERSION)]
     final_program = []
 
     def _merge(self, p1, p2):

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_sourcepos.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_sourcepos.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_sourcepos.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -60,7 +60,7 @@
 class SourcePosTestCase(unittest.TestCase):
 
     def parse(self, eng, s, fn):
-        gen = TALGenerator(expressionCompiler=eng, xml=0, source_file=fn)
+        gen = TALGenerator(expressionCompiler=eng, source_file=fn)
         parser = HTMLTALParser(gen)
         parser.parseString(s)
         program, macros = parser.getCode()

Modified: Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_talinterpreter.py
===================================================================
--- Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_talinterpreter.py	2005-10-14 18:52:49 UTC (rev 39455)
+++ Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/src/zope/tal/tests/test_talinterpreter.py	2005-10-14 21:19:39 UTC (rev 39456)
@@ -63,9 +63,6 @@
         else:
             self.fail("Expected METALError")
 
-    def test_mode_error(self):
-        self.macro[1] = ("mode", "duh")
-
     def test_version_error(self):
         self.macro[0] = ("version", "duh")
 
@@ -232,7 +229,6 @@
 
     def test_translate_static_text_as_dynamic_from_bytecode(self):
         program =  [('version', TAL_VERSION),
- ('mode', 'html'),
 ('setPosition', (1, 0)),
 ('beginScope', {'i18n:translate': ''}),
 ('startTag', ('div', [('i18n:translate', '', 'i18n')])),
@@ -330,7 +326,7 @@
             '<p>SOME STATIC TEXT AND A <a href="url">LINK TEXT</a>.</p>\n',
             result.getvalue())
 
-    def test_for_raw_msgids(self):
+    def dont_test_for_raw_msgids(self):
         # Test for Issue 314: i18n:translate removes line breaks from
         # <pre>...</pre> contents
         # HTML mode
@@ -376,7 +372,7 @@
             '<pre>THIS IS TEXT <B> FOR</B> BARVALUE.</pre>\n',
             result.getvalue())
 
-    def test_raw_msgids_and_i18ntranslate_i18nname(self):
+    def dont_test_raw_msgids_and_i18ntranslate_i18nname(self):
         self.engine.translationDomain.clearMsgids()
         result = StringIO()
         program, macros = self._compile(



More information about the Zope3-Checkins mailing list