Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e84bf751
Commit
e84bf751
authored
Sep 24, 2000
by
Lars Gustäbel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to new SAX method signatures (*NS, patch 101573).
parent
f43cf31f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Lib/xml/dom/pulldom.py
Lib/xml/dom/pulldom.py
+6
-6
No files found.
Lib/xml/dom/pulldom.py
View file @
e84bf751
import
minidom
import
xml.sax
#todo:
SAX2/
namespace handling
#todo: namespace handling
START_ELEMENT
=
"START_ELEMENT"
END_ELEMENT
=
"END_ELEMENT"
...
...
@@ -19,13 +19,13 @@ class PullDOM:
def
setDocumentLocator
(
self
,
locator
):
pass
def
startElement
(
self
,
name
,
tagName
,
attrs
):
def
startElement
(
self
,
name
,
attrs
):
if
not
hasattr
(
self
,
"curNode"
):
# FIXME: hack!
self
.
startDocument
()
node
=
self
.
document
.
createElement
(
tagName
)
#FIXME namespaces!
for
attr
in
attrs
.
key
s
():
node
=
self
.
document
.
createElement
(
name
)
for
(
attr
,
value
)
in
attrs
.
item
s
():
node
.
setAttribute
(
attr
,
attrs
[
attr
])
parent
=
self
.
curNode
...
...
@@ -34,12 +34,12 @@ class PullDOM:
node
.
previousSibling
=
parent
.
childNodes
[
-
1
]
node
.
previousSibling
.
nextSibling
=
node
self
.
curNode
=
node
# FIXME: do I have to screen namespace attributes
self
.
lastEvent
[
1
]
=
[(
START_ELEMENT
,
node
),
None
]
self
.
lastEvent
=
self
.
lastEvent
[
1
]
#self.events.append((START_ELEMENT, node))
def
endElement
(
self
,
name
,
tagName
):
def
endElement
(
self
,
name
):
node
=
self
.
curNode
self
.
lastEvent
[
1
]
=
[(
END_ELEMENT
,
node
),
None
]
self
.
lastEvent
=
self
.
lastEvent
[
1
]
...
...
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