Python: Which XML parser supports XMLNS custom definitions?

eurrogroupp

New Member
I have the below XML file, currently I am using minidom and I get for the example the \[code\]documentElement\[/code\]'s \[code\]tagName\[/code\] as being \[code\]xyz:widget\[/code\] that tells me that it ignores the \[code\]!ENTITY\[/code\] definitions and the\[code\]!DOCTYPE\[/code\] reference.Which XML parser supports !ENTITY definitions and !DOCTYPE reference: \[code\]<?xml version="1.0" standalone="yes" ?><!DOCTYPE widget [<!ENTITY widgets-ns "http://www.w3.org/ns/widgets"><!ENTITY pass "pass&.html">]><xyz:widget xmlns:xyz="&widgets-ns;"> <xyz:content src="http://stackoverflow.com/questions/12729239/&pass;"/> <xyz:name>bv</xyz:name></xyz:widget>\[/code\]So that for the above example, you can get using python the \[code\]XML\[/code\] equivalent:\[code\]<widget xmlns="http://www.w3.org/ns/widgets"> <content src="http://stackoverflow.com/questions/12729239/pass&.html"/> <name>bv</name></widget>\[/code\]or to get a \[code\]DOM\[/code\] that has as a \[code\]documentElement\[/code\] as \[code\]widget\[/code\] and its \[code\]childNodes\[/code\] as \[code\]content\[/code\] and \[code\]name\[/code\], \[code\]widget\[/code\] attribute as \[code\]xmlns\[/code\] with value \[code\]http://www.w3.org/ns/widgets\[/code\], etcI probably may not used the correct terminology, but I hope I made myself clear with the help of the above examples.
 
Back
Top