PureXML/Sources/XPointer/XPointerError.swift
Mihaela Mihaljevic 627c035c2a feat(xpointer): element() and xpointer() schemes
Add the PureXML.XPointer namespace resolving the shorthand bare-name form
(id), the element() scheme (child-element positions from an id or the
document root), and the xpointer() scheme (a full XPath expression). Scheme
parts chain with the XPointer fallback rule: the first non-empty selection
wins. element() data is translated to the equivalent XPath and evaluated by
PureXML.XPath, so no separate evaluator is needed.

Closes #46
Closes #47
Closes #23
2026-06-08 05:52:23 +02:00

17 lines
520 B
Swift

public extension PureXML.XPointer {
/// An error parsing an XPointer.
enum XPointerError: Swift.Error, Equatable, Sendable, CustomStringConvertible {
case empty
case malformed
case unknownScheme(String)
public var description: String {
switch self {
case .empty: "the XPointer is empty"
case .malformed: "the XPointer is malformed"
case let .unknownScheme(name): "unknown XPointer scheme '\(name)'"
}
}
}
}