An open API service indexing awesome lists of open source software.

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

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

![benchmark](Figure_1.png)

* 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';
}
}
```