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
1e717490
Commit
1e717490
authored
Feb 09, 2001
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Once again adapt to changes in the way ParsedXML report namespace
declarations.
parent
78afec1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
lib/python/TAL/TALCompiler.py
lib/python/TAL/TALCompiler.py
+16
-12
No files found.
lib/python/TAL/TALCompiler.py
View file @
1e717490
...
...
@@ -92,7 +92,7 @@ from xml.dom import Node
from
DOMVisitor
import
DOMVisitor
from
TALDefs
import
ZOPE_TAL_NS
,
ZOPE_METAL_NS
,
NAME_RE
from
TALDefs
import
ZOPE_TAL_NS
,
ZOPE_METAL_NS
,
NAME_RE
,
XMLNS_NS
from
TALDefs
import
macroIndexer
,
slotIndexer
from
TALDefs
import
splitParts
,
parseAttributeReplacements
from
TALDefs
import
parseSubstitution
...
...
@@ -171,28 +171,32 @@ 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
=
[]
# Add namespace declarations for the node itself
# First, call newNS() for explicit xmlns and xmlns:prefix attributes
for
attr
in
node
.
attributes
.
values
():
if
attr
.
namespaceURI
==
XMLNS_NS
:
# This is a namespace declaration
# XXX Should be able to use prefix and localName, but can't
name
=
attr
.
name
i
=
string
.
find
(
name
,
':'
)
if
i
<
0
:
declPrefix
=
None
else
:
declPrefix
=
name
[
i
+
1
:]
self
.
newNS
(
declPrefix
,
attr
.
value
)
# Add namespace declarations for the node itself, if needed
if
node
.
namespaceURI
:
if
self
.
newNS
(
node
.
prefix
,
node
.
namespaceURI
):
if
node
.
prefix
:
list
.
append
((
"xmlns:"
+
node
.
prefix
,
node
.
namespaceURI
))
else
:
list
.
append
((
"xmlns"
,
node
.
namespaceURI
))
# Add namespace declarations for each attribute
# Add namespace declarations for each attribute
, if needed
for
attr
in
node
.
attributes
.
values
():
if
attr
.
namespaceURI
:
if
not
attr
.
prefix
:
if
attr
.
namespaceURI
==
XMLNS_NS
:
continue
if
self
.
newNS
(
attr
.
prefix
,
attr
.
namespaceURI
):
if
attr
.
prefix
==
"xmlns"
:
continue
if
attr
.
prefix
:
list
.
append
(
(
"xmlns:"
+
attr
.
prefix
,
attr
.
namespaceURI
))
...
...
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