Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
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)
1
Konular (issue)
1
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ç
SulinOS
inary
Commits
8982c06e
Kaydet (Commit)
8982c06e
authored
Kas 10, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* trying to solve the damn thing, use XML namespace for attribute
access * we got an attribute related error, no wonder...
üst
abe9b753
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
autoxml.py
pisi/xml/autoxml.py
+2
-2
xmlextcdom.py
pisi/xml/xmlextcdom.py
+6
-2
xmlfilecdom.py
pisi/xml/xmlfilecdom.py
+4
-0
No files found.
pisi/xml/autoxml.py
Dosyayı görüntüle @
8982c06e
...
...
@@ -101,7 +101,7 @@ class LocalText(dict):
assert
self
.
tag
!=
''
for
key
in
self
.
iterkeys
():
newnode
=
newNode
(
node
,
self
.
tag
)
newnode
.
setAttributeNS
(
None
,
'xml:lang'
,
key
)
newnode
.
setAttributeNS
(
XML_NS
,
'xml:lang'
,
key
)
newtext
=
newTextNode
(
node
,
self
[
key
])
newnode
.
appendChild
(
newtext
)
node
.
appendChild
(
newnode
)
...
...
@@ -423,7 +423,7 @@ class autoxml(oo.autosuper, oo.autoprop):
return
getNodeAttribute
(
node
,
attr
)
def
writetext
(
node
,
attr
,
text
):
#print 'write attr', attr, text
node
.
setAttributeNS
(
None
,
attr
,
text
)
node
.
setAttributeNS
(
XML_NS
,
attr
,
text
)
anonfuns
=
cls
.
gen_anon_basic
(
attr
,
spec
,
readtext
,
writetext
)
return
cls
.
gen_named_comp
(
attr
,
spec
,
anonfuns
)
...
...
pisi/xml/xmlextcdom.py
Dosyayı görüntüle @
8982c06e
...
...
@@ -35,6 +35,10 @@ import Ft
from
Ft.Xml.Domlette
import
implementation
from
Ft.Xml
import
ParsePath
from
Ft.Xml.Domlette
import
NonvalidatingReader
from
xml.dom
import
XHTML_NAMESPACE
,
XML_NAMESPACE
XHTML_NS
=
unicode
(
XHTML_NAMESPACE
)
XML_NS
=
unicode
(
XML_NAMESPACE
)
import
pisi
...
...
@@ -67,10 +71,10 @@ def newTextNode(node, text):
def
getNodeAttribute
(
node
,
attrname
):
"""get named attribute from DOM node"""
if
not
node
.
hasAttributeNS
(
None
,
attrname
):
if
not
node
.
hasAttributeNS
(
XML_NS
,
attrname
):
return
None
else
:
return
node
.
getAttributeNS
(
None
,
attrname
)
return
node
.
getAttributeNS
(
XML_NS
,
attrname
)
def
getChildElts
(
node
):
"""get only child elements"""
...
...
pisi/xml/xmlfilecdom.py
Dosyayı görüntüle @
8982c06e
...
...
@@ -36,6 +36,10 @@ from Ft.Xml.Domlette import implementation
from
Ft.Xml.Domlette
import
NonvalidatingReader
from
Ft.Xml
import
Parse
,
ParsePath
from
Ft.Xml.Domlette
import
Print
,
PrettyPrint
from
xml.dom
import
XHTML_NAMESPACE
,
XML_NAMESPACE
XHTML_NS
=
unicode
(
XHTML_NAMESPACE
)
XML_NS
=
unicode
(
XML_NAMESPACE
)
import
pisi
...
...
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