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_RETURNPOSITIONS
return position of tags in fourth entry in tuple
FLAG_IGNOREENTITIES
does not resolve entities when set
And one exception:
XMLParseException
Release files for speedyxml 0.4.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| speedyxml-0.4.1.1.tar.gz | 12.9 kB | Details |
Release files / speedyxml-0.4.1.1.tar.gz
| Download URL | speedyxml-0.4.1.1.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2f781f0c2ae06800d7eed58f69f11fc0224297bf26c0efdd55f683e3febbf6f
|
|
BLAKE2b-256 checksum How to use checksums |
19591b7acc303c788fd5084132f376d7d77905a39fbe5a31e8eff846479e9552
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|