https://github.com/sharp0802/frxml
A simple zero-copy/single-pass XML parser, written in C++17
https://github.com/sharp0802/frxml
Last synced: about 1 year ago
JSON representation
A simple zero-copy/single-pass XML parser, written in C++17
- Host: GitHub
- URL: https://github.com/sharp0802/frxml
- Owner: Sharp0802
- License: mit
- Created: 2024-08-04T13:35:32.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-20T04:10:12.000Z (over 1 year ago)
- Last Synced: 2025-01-25T22:34:22.358Z (over 1 year ago)
- Language: C++
- Size: 220 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: docs/README.md
- License: LICENSE
Awesome Lists containing this project
README
# FRXML : Fast/Robust XML parser
FRXML is DOM-based light-weight & robust XML parser, written in C++17 - with a goal
that is to archive `O(n)` level of memory occupancy,
regardless of how deep the depth of the xml document is
## Benchmark

* lower is better
## Features
- zero-copy/single-pass parsing
- UTF-8 supported (without BOM)
- limited XML 1.0
## Limitation
- No `` things such as `' content '' name '>'
empty_element ::= '<' name (S attr)* S? '/>'
comment ::= ''
pcinstr ::= '' name (S (CHAR* - (CHAR* '?>' CHAR*)))? '?>'
content ::= node (S? content)?
```
## Usage
### Parsing
```c++
#include
#include
int main()
{
std::string xml = R"(
<유니코드 attr="안녕하세요" attr0="1">
유니코드>
)";
frxml::doc doc{ xml };
if (!doc)
{
std::cout << std::to_string(error.exception()) << '\n';
}
}
```