public override void Visit(DOM.Element element) { _namespaceResolver.ProcessNsPrefix((IMappedPair)element); ProcessInterpolation((IPairWithInterpolation)element); base.Visit(element); Visit(element.PairValue); }
public override void OnElement(DOM.Element element) { if (!((Element)element).IsChoice) { CheckBlockIntegrity(element); CheckPairValue(element); CheckArrayItem((Element)element); CheckInterpolation((Element)element); } _blockStateUnknown = true; var prevBlockStateCount = _blockState.Count; EnterChoiceNode(element); if (((Element)element).IsChoice) { CheckInterpolation((Element)element); } if (CheckStartOfChoiceContainer(element, element.Entities)) { base.OnElement(element); EndChoiceContainer(); } else { CheckArrayDelimiter(element); base.OnElement(element); } ExitChoiceNode(element); _blockStateUnknown = false; if (_blockState.Count > prevBlockStateCount) { _blockState.Pop(); } }
private void EnterChoiceNode(DOM.Element element) { if (!((IChoiceNode)element).IsChoice) { return; } ChoiceInfo parent = _choiceStack.Count == 0 ? null : _choiceStack.Peek(); var choiceInfo = new ChoiceInfo(parent, element); _choiceStack.Push(choiceInfo); }
/// <summary> /// If choice fails then it adds all errors to the parent container, /// otherwise the choice adds itself to the parent child list. /// </summary> /// <param name="element"></param> private void ExitChoiceNode(DOM.Element element) { if (((IChoiceNode)element).IsChoice) { var choice = _choiceStack.Pop(); if (choice.Errors != null) { foreach (var error in choice.Errors) { choice.Parent.AddError(error); } } else if (choice.Parent.Children == null) { choice.Parent.AddChild(choice); } } }
public override void Visit(DOM.Element element) { if (!((Element)element).IsChoice) { CheckBlockIntegrity(element); CheckPairValue(element); CheckArrayItem((Element)element); CheckInterpolation((Element)element); } var prevBlockStateCount = _blockState.Count; var isBlockElement = string.IsNullOrEmpty(element.Name) && element.Assignment == AssignmentEnum.None; if (!isBlockElement) { _blockStateUnknown = true; } EnterChoiceNode(element); if (((Element)element).IsChoice) { CheckInterpolation((Element)element); } if (CheckStartOfChoiceContainer(element, element.Entities)) { base.Visit(element); EndChoiceContainer(); } else { CheckExplicitBlockTypeDef(element); base.Visit(element); } ExitChoiceNode(element); _blockStateUnknown = false; if (_blockState.Count > prevBlockStateCount) { _blockState.Pop(); } }
/// <inheritdoc /> public override void Visit(DOM.Element element) { ResolveAttributes(element.Entities); Visit(element.Entities.Where(e => !(e is DOM.Attribute))); }
public override void OnElement(DOM.Element pair) { ResolveAttributes(pair.Entities); Visit(pair.Entities.Where(e => !(e is DOM.Attribute))); }