Class XmlParseContext
The traversal state one document is parsed with: the registry, the error collector (every
problem of the document in one pass, with positions), the value converter shared with the
endpoint options, and the recursion helper scopes call for their children.
public sealed class XmlParseContext
Inheritance
Properties
Errors
All collected errors, each with its file position.
public IReadOnlyList<string> Errors { get; }
Registry
The element registry the traversal dispatches through.
public ElementRegistry Registry { get; }
RouteContext
The context routes are being loaded into (registry lookups, component names).
public IRouteContext RouteContext { get; }
Methods
AddError(XElement, string)
Records a problem at the element's position; parsing continues.
public void AddError(XElement element, string message)
ApplyBranchIdentity(XElement, IRouteDefinition)
Identity for a branch child (<when>, <otherwise>,
public void ApplyBranchIdentity(XElement element, IRouteDefinition definition)
Attr(XElement, string)
The attribute's value, or null when absent. Attributes of foreign namespaces are ignored.
public string? Attr(XElement element, string name)
Convert<T>(XElement, string)
Converts an attribute through the same converter the endpoint options use (invariant
public T? Convert<T>(XElement element, string name) where T : struct
ExactlyOneOf(XElement, string, string)
Enforces the exactly-one-of rule for a pair of attributes (value vs
public (string Name, string Value)? ExactlyOneOf(XElement element, string first, string second)
NoteEndpointUri(XElement, string, EndpointRole)
Notes an endpoint URI and the side the step creates (<from> the consumer, every other step the
public void NoteEndpointUri(XElement element, string uri, EndpointRole side)
NoteEndpointUri(XElement, string)
Notes an endpoint URI a step sends to, for the post-parse scheme check. URIs led by {{…}} or
public void NoteEndpointUri(XElement element, string uri)
ParseStep(XElement, IRouteDefinition)
Parses one element as a step (see ).
public IRouteDefinition ParseStep(XElement element, IRouteDefinition current)
ParseSteps(XElement, IRouteDefinition)
Parses the child elements of parent as a step sequence into
public IRouteDefinition ParseSteps(XElement parent, IRouteDefinition current)
Position(XElement)
The file(line,column) prefix of an element.
public string Position(XElement element)
RequiredAttr(XElement, string)
The attribute's value; records an error and returns null when absent or blank — the
public string? RequiredAttr(XElement element, string name)