[Zope-Checkins] CVS: Zope/lib/python/TAL - TALDefs.py:1.35 TALGenerator.py:1.62 TALParser.py:1.22
Fred L. Drake, Jr.
fred@zope.com
Thu, 20 Mar 2003 14:58:58 -0500
Update of /cvs-repository/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv2699
Modified Files:
TALDefs.py TALGenerator.py TALParser.py
Log Message:
XML attribute names are case-sensitive; do not lower-case them!
This corresponds to Zope 3 collector issue 129.
http://collector.zope.org/Zope3-dev/129
=== Zope/lib/python/TAL/TALDefs.py 1.34 => 1.35 ===
--- Zope/lib/python/TAL/TALDefs.py:1.34 Mon Dec 16 18:24:32 2002
+++ Zope/lib/python/TAL/TALDefs.py Thu Mar 20 14:58:27 2003
@@ -113,14 +113,15 @@
_subst_re = re.compile(r"\s*(?:(text|structure)\s+)?(.*)\Z", re.S)
del re
-def parseAttributeReplacements(arg):
+def parseAttributeReplacements(arg, xml):
dict = {}
for part in splitParts(arg):
m = _attr_re.match(part)
if not m:
raise TALError("Bad syntax in attributes:" + `part`)
name, expr = m.group(1, 2)
- name = name.lower()
+ if not xml:
+ name = name.lower()
if dict.has_key(name):
raise TALError("Duplicate attribute name in attributes:" + `part`)
dict[name] = expr
=== Zope/lib/python/TAL/TALGenerator.py 1.61 => 1.62 ===
--- Zope/lib/python/TAL/TALGenerator.py:1.61 Mon Dec 16 18:24:32 2002
+++ Zope/lib/python/TAL/TALGenerator.py Thu Mar 20 14:58:27 2003
@@ -646,7 +646,8 @@
self.pushProgram()
if attrsubst or i18nattrs:
if attrsubst:
- repldict = TALDefs.parseAttributeReplacements(attrsubst)
+ repldict = TALDefs.parseAttributeReplacements(attrsubst,
+ self.xml)
else:
repldict = {}
if i18nattrs:
=== Zope/lib/python/TAL/TALParser.py 1.21 => 1.22 ===
--- Zope/lib/python/TAL/TALParser.py:1.21 Mon Dec 16 18:21:31 2002
+++ Zope/lib/python/TAL/TALParser.py Thu Mar 20 14:58:27 2003
@@ -72,7 +72,7 @@
for key, value in attrlist:
key, keybase, keyns = self.fixname(key)
ns = keyns or namens # default to tag namespace
- item = key.lower(), value
+ item = key, value
if ns == 'metal':
metaldict[keybase] = value
item = item + ("metal",)