Expand description
Simple XML parsing utilities for extracting content and attributes.
These functions operate on XML strings and provide basic extraction capabilities without requiring a full XML parser. They are designed for the structured XML used in LLM prompts, which tends to be well-formed and predictable.
For complex XML parsing needs, consider using a full parser like quick-xml.
Enums§
- XmlError
- Error type for XML parsing operations.
Functions§
- extract_
all_ tag_ contents - Extracts all occurrences of a tag’s text content.
- extract_
attr - Extracts the value of an attribute from the first occurrence of a tag.
- extract_
raw_ inner_ xml - Extracts the raw (unprocessed) inner XML of a tag, including nested tags.
- extract_
tag_ content - Extracts the text content of the first occurrence of a tag.
- has_tag
- Checks if a specific tag exists in the XML string.