Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
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ç
LibreOffice
core
Commits
0da23c09
Kaydet (Commit)
0da23c09
authored
Agu 29, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove unused prefix attribute of namespace elements
Change-Id: I6fd33f9050eb3f7394315bbd0c617513767adce6
üst
8d57c90b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
25 deletions
+1
-25
modelpreprocess.py
writerfilter/source/ooxml/modelpreprocess.py
+1
-25
No files found.
writerfilter/source/ooxml/modelpreprocess.py
Dosyayı görüntüle @
0da23c09
...
...
@@ -23,7 +23,7 @@ def prefixFromUrl(url):
def
prefixForGrammar
(
namespace
):
ns
=
n
sForGrammar
(
namespace
)
ns
=
n
amespace
.
getElementsByTagName
(
"grammar"
)[
0
]
.
getAttribute
(
"ns"
)
if
ns
in
list
(
ooxUrlAliases
.
keys
()):
prefix
=
ooxUrlAliases
[
ns
]
return
prefix
...
...
@@ -31,10 +31,6 @@ def prefixForGrammar(namespace):
return
prefixFromUrl
(
ns
)
def
nsForGrammar
(
namespace
):
return
namespace
.
getElementsByTagName
(
"grammar"
)[
0
]
.
getAttribute
(
"ns"
)
def
parseNamespaceAliases
(
node
,
ret
):
for
k
,
v
in
list
(
node
.
attributes
.
items
()):
if
k
.
startswith
(
"xmlns:"
):
...
...
@@ -70,14 +66,7 @@ def check(model):
def
preprocess
(
model
):
for
i
in
model
.
getElementsByTagName
(
"namespace"
):
ns
=
i
.
getElementsByTagName
(
"grammar"
)[
0
]
.
getAttribute
(
"ns"
)
if
ns
.
startswith
(
"http://schemas.openxmlformats.org/"
):
i
.
setAttribute
(
"prefix"
,
ns
.
replace
(
'http://schemas.openxmlformats.org/'
,
''
)
.
replace
(
'/'
,
'_'
)
.
replace
(
'-'
,
'_'
))
else
:
i
.
setAttribute
(
"prefix"
,
""
)
grammarprefix
=
prefixForGrammar
(
i
)
grammarns
=
nsForGrammar
(
i
)
grammarNamespaceAliases
=
defaultNamespaceAliases
()
grammar
=
i
.
getElementsByTagName
(
"grammar"
)[
0
]
...
...
@@ -110,19 +99,6 @@ def preprocess(model):
else
:
prefix
=
grammarprefix
# ns
ns
=
""
if
":"
in
j
.
getAttribute
(
"name"
):
nameprefix
=
j
.
getAttribute
(
"name"
)
.
split
(
':'
)[
0
]
if
nameprefix
in
list
(
localNamespaceAliases
.
keys
()):
ns
=
localNamespaceAliases
[
nameprefix
]
elif
j
.
localName
==
"attribute"
:
# if parent node is resource, then we're outside the grammar element
if
grammar
.
getAttribute
(
"attributeFormDefault"
)
==
"qualified"
and
not
j
.
parentNode
.
localName
==
"resource"
:
ns
=
grammarns
else
:
ns
=
grammarns
# localname
if
":"
in
j
.
getAttribute
(
"name"
):
localname
=
j
.
getAttribute
(
"name"
)
.
split
(
':'
)[
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