Parser entry points for source-edit fragments.
More...
#include "donner/base/xml/XMLIncrementalParser.h"
Parser entry points for source-edit fragments.
These helpers parse the bounded XML scopes used by XMLDocument::applySourceEdit. Returned documents own a temporary source store whose source locations are relative to the parsed fragment; callers that install the parsed metadata into a live document must offset those ranges by the fragment's source offset.
◆ ParseAttribute()
| ParseResult< XMLDocument > donner::xml::XMLIncrementalParser::ParseAttribute |
( |
std::string_view | attributeSource | ) |
|
|
static |
Parse one attribute source fragment by wrapping it in a synthetic element.
- Parameters
-
| attributeSource | Source bytes such as fill="red". |
- Returns
- Parsed temporary XML document, or a parse diagnostic.
◆ ParseElement()
Parse one element subtree source fragment.
- Parameters
-
| elementSource | Source bytes for the complete element subtree. |
- Returns
- Parsed temporary XML document, or a parse diagnostic.
◆ ParseOpeningTag()
| ParseResult< XMLDocument > donner::xml::XMLIncrementalParser::ParseOpeningTag |
( |
std::string_view | openingTagSource | ) |
|
|
static |
Parse one opening tag source fragment.
The opening tag is converted to a self-closing tag when needed so attributes can be parsed without reparsing the element body.
- Parameters
-
| openingTagSource | Source bytes such as <rect fill="red">. |
- Returns
- Parsed temporary XML document, or a parse diagnostic.
◆ ParsePcdata()
Parse parsed-character-data source by wrapping it in a synthetic element.
- Parameters
-
| textSource | Source bytes from an element text span. |
- Returns
- Parsed temporary XML document, or a parse diagnostic.
◆ ParseTextLikeNode()
| ParseResult< XMLDocument > donner::xml::XMLIncrementalParser::ParseTextLikeNode |
( |
std::string_view | nodeSource | ) |
|
|
static |
Parse one raw text-like node source fragment.
This is used for CDATA sections, XML comments, and processing instructions.
- Parameters
-
| nodeSource | Source bytes for the complete text-like node. |
- Returns
- Parsed temporary XML document, or a parse diagnostic.
The documentation for this class was generated from the following file: