|
|
Donner
C++20 SVG rendering library
|
Parses an XML document from a string. More...
#include "donner/base/xml/XMLParser.h"
Classes | |
| struct | Options |
| Options to modify the parsing behavior. More... | |
Static Public Member Functions | |
| static ParseResult< XMLDocument > | Parse (std::string_view str, const Options &options=Options()) |
| Parse an XML string with the given options. | |
| static std::optional< FileOffsetRange > | GetAttributeLocation (std::string_view str, FileOffset elementStartOffset, const XMLQualifiedNameRef &attributeName) |
| Parse the XML attributes and get the source location of a specific attribute. | |
Parses an XML document from a string.
The document tree will remain valid as long as the returned XMLDocument is alive.
|
static |
Parse the XML attributes and get the source location of a specific attribute.
For example, for the following XML:
The FileOffsetRange for the attr attribute should contain the substring attr="Hello, world!"
| str | XML data to parse. Will not be modified. |
| elementStartOffset | Start offset of the element in the input string. |
| attributeName | Name of the attribute to find. |
|
static |
Parse an XML string with the given options.
By default, the parser will ignore comments, the doctype node, and processing instructions. To enable parsing these nodes, configure the flags within Options.
The document tree will remain valid as long as the returned XMLDocument is alive.
| str | XML data to parse. Will not be modified. |
| options | Options to modify the parsing behavior. |