public void SetupNodes(DotPath nodeDotPath, IEnumerable <IDictionary <string, string> > tokensList) { foreach (var tokens in tokensList) { SetupNode(nodeDotPath, tokens); } }
public void SetupNode(DotPath nodeDotPath, IDictionary <string, string> tokens) { var node = _document.Root.DotPathSelectElementOrThrow(nodeDotPath, _nsMgr); if (_updatedNodes.Contains(nodeDotPath.DotPathString)) { //This node has been already updated in the template with test data //Let's clone it, add the clone as next sibling and use the cloned node for updating var clone = new XElement(node); node.AddAfterSelf(clone); node = clone; } else { _updatedNodes.Add(nodeDotPath.DotPathString); } foreach (var token in tokens) { var tokenDotPath = new DotPath(token.Key); var elementOrAttribute = node.DotPathSelectElementOrAttributeOrThrow(tokenDotPath, _nsMgr); elementOrAttribute.SetValue(token.Value); } }
public DotPathAngleBrackets(int startIndex, int length, DotPath dotPath, AngleBrackets angleBrackets) { this.startIndex = startIndex; this.length = length; this.dotPath = dotPath; this.angleBrackets = angleBrackets; }