Safely escape ampersands in XML without double-encoding
Project description
xml-sanitizer
Safely escape illegal ampersands in XML without double-encoding.
Why?
XML breaks if raw & exists:
- Jack & Tom : It will break
- Jack & Tom : It works for xml without breaking
This library fixes that safely.
Installation
pip install xml-sanitizer
Usage
from xml_sanitizer import xml_content_cleanup
parsed_xml = xml_content_cleanup(xml_file)
print(f"Cleaned XML: {parsed_xml}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xml_sanitizer-0.1.1.tar.gz
(1.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xml_sanitizer-0.1.1.tar.gz.
File metadata
- Download URL: xml_sanitizer-0.1.1.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cedec3381af61b7c366b4f1028fb12a8ac8bd700eddd95430cf4cb741b90dce
|
|
| MD5 |
9a9ccbdc04d944b011b3b863efe79605
|
|
| BLAKE2b-256 |
030f8879c949b0c39a29f3315b36bb86cc8d4553bcfefd0c752e5916faad3185
|
File details
Details for the file xml_sanitizer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: xml_sanitizer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ac2cbe05a81a37be5562fbc9a4520f09138f7331324385d8b9b58a252bf27d5
|
|
| MD5 |
bcff9a8b29b29eb8a97c76f6f1cd409f
|
|
| BLAKE2b-256 |
2010618e9816400e4da92473f9e6073831b37c8cf2cbaf7ee0a09e81b9fbba9d
|