Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e84bf751
Kaydet (Commit)
e84bf751
authored
Eyl 24, 2000
tarafından
Lars Gustäbel
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Updated to new SAX method signatures (*NS, patch 101573).
üst
f43cf31f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
pulldom.py
Lib/xml/dom/pulldom.py
+6
-6
No files found.
Lib/xml/dom/pulldom.py
Dosyayı görüntüle @
e84bf751
import
minidom
import
minidom
import
xml.sax
import
xml.sax
#todo:
SAX2/
namespace handling
#todo: namespace handling
START_ELEMENT
=
"START_ELEMENT"
START_ELEMENT
=
"START_ELEMENT"
END_ELEMENT
=
"END_ELEMENT"
END_ELEMENT
=
"END_ELEMENT"
...
@@ -19,13 +19,13 @@ class PullDOM:
...
@@ -19,13 +19,13 @@ class PullDOM:
def
setDocumentLocator
(
self
,
locator
):
pass
def
setDocumentLocator
(
self
,
locator
):
pass
def
startElement
(
self
,
name
,
tagName
,
attrs
):
def
startElement
(
self
,
name
,
attrs
):
if
not
hasattr
(
self
,
"curNode"
):
if
not
hasattr
(
self
,
"curNode"
):
# FIXME: hack!
# FIXME: hack!
self
.
startDocument
()
self
.
startDocument
()
node
=
self
.
document
.
createElement
(
tagName
)
#FIXME namespaces!
node
=
self
.
document
.
createElement
(
name
)
for
attr
in
attrs
.
key
s
():
for
(
attr
,
value
)
in
attrs
.
item
s
():
node
.
setAttribute
(
attr
,
attrs
[
attr
])
node
.
setAttribute
(
attr
,
attrs
[
attr
])
parent
=
self
.
curNode
parent
=
self
.
curNode
...
@@ -34,12 +34,12 @@ class PullDOM:
...
@@ -34,12 +34,12 @@ class PullDOM:
node
.
previousSibling
=
parent
.
childNodes
[
-
1
]
node
.
previousSibling
=
parent
.
childNodes
[
-
1
]
node
.
previousSibling
.
nextSibling
=
node
node
.
previousSibling
.
nextSibling
=
node
self
.
curNode
=
node
self
.
curNode
=
node
# FIXME: do I have to screen namespace attributes
self
.
lastEvent
[
1
]
=
[(
START_ELEMENT
,
node
),
None
]
self
.
lastEvent
[
1
]
=
[(
START_ELEMENT
,
node
),
None
]
self
.
lastEvent
=
self
.
lastEvent
[
1
]
self
.
lastEvent
=
self
.
lastEvent
[
1
]
#self.events.append((START_ELEMENT, node))
#self.events.append((START_ELEMENT, node))
def
endElement
(
self
,
name
,
tagName
):
def
endElement
(
self
,
name
):
node
=
self
.
curNode
node
=
self
.
curNode
self
.
lastEvent
[
1
]
=
[(
END_ELEMENT
,
node
),
None
]
self
.
lastEvent
[
1
]
=
[(
END_ELEMENT
,
node
),
None
]
self
.
lastEvent
=
self
.
lastEvent
[
1
]
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