pub enum ParseError {
InvalidXml(String),
WrongRootNamespace {
found: Option<String>,
position: Position,
},
NoPatterns,
MissingAttribute {
element: &'static str,
attribute: &'static str,
position: Position,
},
UnknownAbstractPattern {
pattern: String,
position: Position,
},
UnknownRuleReference {
rule: String,
position: Position,
},
CyclicRuleExtends {
rule: String,
position: Position,
},
UnexpectedElement {
element: String,
position: Position,
},
DuplicateId {
element: &'static str,
id: String,
position: Position,
},
UnknownActivePattern {
pattern: String,
position: Position,
},
UnknownDiagnosticReference {
id: String,
position: Position,
},
}Expand description
An error encountered while parsing a Schematron schema.
Variants§
InvalidXml(String)
The input is not well-formed XML.
WrongRootNamespace
The root element is not <schema> in the Schematron namespace.
NoPatterns
The schema contains no <pattern> elements.
MissingAttribute
A required attribute is missing on an element.
UnknownAbstractPattern
<pattern is-a="..."> referenced a pattern id with no matching
<pattern abstract="true" id="..."> in the schema.
UnknownRuleReference
<extends rule="..."> referenced a rule id with no matching
<rule id="..."> in the same pattern (see
plan/07-abstract-patterns-and-extends.md for why the lookup is
pattern-local, not schema-wide).
CyclicRuleExtends
<extends> formed a cycle (a rule extending itself, directly or
transitively).
UnexpectedElement
A Schematron-namespace element appeared as a direct child of a
container it is not part of that container’s grammar — either a
typo of a known element (e.g. <asert>), or a real ISO Schematron
construct this crate does not implement (e.g. <include>). See
README.md’s support matrix. Foreign-namespace elements are never
affected — ISO’s own “foreign” content model already allows those
anywhere, regardless of this crate’s support.
DuplicateId
Two elements in the same ID space (pattern/@id or
diagnostic/@id) declared the same id — ambiguous for anything
that references it by IDREF(S) (active/@pattern,
assert|report/@diagnostics).
UnknownActivePattern
<active pattern="..."> referenced a pattern id with no matching
concrete <pattern id="..."> in the schema (abstract-pattern ids
don’t count — they never appear in Schema.patterns; compare
UnknownAbstractPattern, which is is-a’s own, separate reference
kind).
UnknownDiagnosticReference
assert|report/@diagnostics referenced a diagnostic id with no
matching <diagnostic id="..."> in the schema.
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
impl Eq for ParseError
Source§impl Error for ParseError
impl Error for ParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()