kilroy42 / speedyxml Goto Github PK
View Code? Open in Web Editor NEWSpeedy XML parser for Python
Speedy XML parser for Python
Usage is fairly straightforward: import speedyxml xml = speedyxml.parse('<xml><test this="now" /></xml>') Will result in: ( u'xml', None, [ ( u'test', {u'this': u'now'}, None ) ] ) So basically its: (nodeName, attributes, children) Plus some options (second argument to parse) FLAG_EXPANDEMPTY If you want empty attributes and children to be {} and [] instead of None, use this FLAG_RETURNCOMMENTS Return comments as: (TAG_COMMENT, None, u' comment ') FLAG_RETURNPI Returns processing instructions as: (TAG_PI, {u'name': u'php'}, u'phpinfo();') FLAG_IGNOREENTITIES does not resolve entities when set And one exception: XMLParseException
Closing tags containing white-space are not recognized.
Error messages is "XML ended unexpectedly in a closing tag"
Example:
<root></root >
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.