Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c9794330
Commit
c9794330
authored
Feb 07, 2001
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't emit xmlns attributes when they are already in the explicit
attribute list.
parent
3d9fa295
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
lib/python/TAL/TALCompiler.py
lib/python/TAL/TALCompiler.py
+13
-1
No files found.
lib/python/TAL/TALCompiler.py
View file @
c9794330
...
...
@@ -140,6 +140,12 @@ class METALCompiler(DOMVisitor):
return
0
def
getFullAttrList
(
self
,
node
):
# First, call newNS() for explicit xmlns attributes
for
attr
in
node
.
attributes
.
values
():
if
attr
.
name
==
"xmlns"
:
self
.
newNS
(
None
,
attr
.
value
)
elif
attr
.
prefix
==
"xmlns"
:
self
.
newNS
(
attr
.
localName
,
attr
.
value
)
list
=
[]
if
node
.
namespaceURI
:
if
self
.
newNS
(
node
.
prefix
,
node
.
namespaceURI
):
...
...
@@ -150,7 +156,13 @@ class METALCompiler(DOMVisitor):
for
attr
in
node
.
attributes
.
values
():
if
attr
.
namespaceURI
:
if
self
.
newNS
(
attr
.
prefix
,
attr
.
namespaceURI
):
list
.
append
((
"xmlns:"
+
attr
.
prefix
,
attr
.
namespaceURI
))
if
attr
.
prefix
==
"xmlns"
:
continue
if
attr
.
prefix
:
list
.
append
(
(
"xmlns:"
+
attr
.
prefix
,
attr
.
namespaceURI
))
else
:
list
.
append
((
"xmlns"
,
node
.
namespaceURI
))
list
.
extend
(
self
.
getAttributeList
(
node
))
return
list
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment