Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1252
xmltodict xmlns
Active
Public
Actions
Authored by
vlorentz
on Jan 10 2022, 2:25 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
>>>
s
=
'<entry xmlns:testns="https://example.org"> <testns:foo> <testns:bar url="http://example.org/1" /> <testns:bar url="http://example.org/2" /></testns:foo> </entry>'
>>>
pprint
(
xmltodict
.
parse
(
s
,
process_namespaces
=
True
,
dict_constructor
=
dict
))
{
'entry'
:
{
'https://example.org:foo'
:
{
'https://example.org:bar'
:
[{
'@url'
:
'http://example.org/1'
,
'@xmlns'
:
OrderedDict
([(
'testns'
,
'https://example.org'
)])},
{
'@url'
:
'http://example.org/2'
}]}}}
Event Timeline
vlorentz
created this paste.
Jan 10 2022, 2:25 PM
2022-01-10 14:25:16 (UTC+1)
vlorentz
edited the content of this paste.
(Show Details)
Log In to Comment