[Zope3-checkins] CVS: Zope3/src/zope/tal - taldefs.py:1.3 talgenerator.py:1.4 talparser.py:1.3
Fred L. Drake, Jr.
fred@zope.com
Thu, 20 Mar 2003 14:41:28 -0500
Update of /cvs-repository/Zope3/src/zope/tal
In directory cvs.zope.org:/tmp/cvs-serv450
Modified Files:
taldefs.py talgenerator.py talparser.py
Log Message:
XML attribute names are case-sensitive; do not lower-case them!
This closes Zope 3 collector issue 129.
http://collector.zope.org/Zope3-dev/129
=== Zope3/src/zope/tal/taldefs.py 1.2 => 1.3 ===
--- Zope3/src/zope/tal/taldefs.py:1.2 Wed Dec 25 09:15:29 2002
+++ Zope3/src/zope/tal/taldefs.py Thu Mar 20 14:41:27 2003
@@ -110,14 +110,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
=== Zope3/src/zope/tal/talgenerator.py 1.3 => 1.4 ===
--- Zope3/src/zope/tal/talgenerator.py:1.3 Thu Mar 13 13:49:19 2003
+++ Zope3/src/zope/tal/talgenerator.py Thu Mar 20 14:41:27 2003
@@ -639,7 +639,8 @@
self.pushProgram()
if attrsubst or i18nattrs:
if attrsubst:
- repldict = taldefs.parseAttributeReplacements(attrsubst)
+ repldict = taldefs.parseAttributeReplacements(attrsubst,
+ self.xml)
else:
repldict = {}
if i18nattrs:
=== Zope3/src/zope/tal/talparser.py 1.2 => 1.3 ===
--- Zope3/src/zope/tal/talparser.py:1.2 Wed Dec 25 09:15:29 2002
+++ Zope3/src/zope/tal/talparser.py Thu Mar 20 14:41:27 2003
@@ -73,7 +73,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",)