ddn.data.xml.query
XPath-like querying entrypoints.
alias selectAll
Types 3
structXmlQueryStep
A parsed query step.
This is a minimal XPath-like model supporting:
- child steps (
a/b) - descendant steps (
//b) - wildcard (`*`)
- basic attribute predicates (
[@id='x'])
Fields
bool descendantOrSelfIf `true`, this step uses descendant-or-self (`//`) instead of child (`/`).string nameElement name to match (`*` means wildcard).string attributeNameOptional attribute predicate name (no namespace).string attributeValueOptional attribute predicate value (empty means only existence check).bool hasAttributePredicateIf `true`, `attributeName`/`attributeValue` are active.size_t indexPredicateOptional positional predicate (1-based). `0` means not present.structXmlPath
An XPath-like query.
Methods
aliasselectAll = xpath
Alias for xpath to provide more traditional DOM-like naming.
Functions 7
fn
XmlElement[] xpath(XmlElement root, string expression) @safeSelects elements matching an XPath-like expression under `root`.fn
Nullable!XmlElement selectFirst(XmlElement root, string expression) @safeSelects the first element matching an XPath-like expression under `root`.private fn
void collectDescendantsOrSelf(ref XmlElement[] sink, XmlElement root, const ref XmlQueryStep step) @safe