Struct ElementNestingValidator

Wrapper around a cursor that checks whether elements are correctly nested.

It will call ErrorHandler whenever it finds a closing tag that does not match the last start tag. ErrorHandler will be called with the first matching tuple from the following:

  • (CursorType, std.container.Array!(CursorType.StringType))
  • (CursorType)
  • (std.container.Array!(CursorType.StringType))
  • ()
Any of these parameters can be taken by ref. The second parameter, of type std.container.Array!(CursorType.StringType) represents the stack of currently open tags. The handler is free to modify it (to implement erro recovery with automatic XML fixing).

This type should not be instantiated directly, but with the helper function elementNestingValidator.

Template arguments

struct ElementNestingValidator(CursorType, alias ErrorHandler)
if (isCursor!CursorType);


Lodovico Giaretta


Copyright Lodovico Giaretta 2016 --


Boost License 1.0.