public static Dictionary <string, string> GetKeysAndXPaths(string path) { var docs = Loader.Load(path); Validator.CheckDocuments(docs); LocatorRenderer.Run(docs); var elements = new List <Element>(); var result = new Dictionary <string, string>(); foreach (var doc in docs.Values) { elements.AddRange(doc.ToGenerationElements().DescendantsAndSelf()); } foreach (var element in elements) { if (!result.ContainsKey(element.Key)) { result.Add(element.Key, element.XPath); } } return(result); }
public string GenerateElements(string path, string elementsNamespace = "") { var docs = Loader.Load(path); Validator.CheckDocuments(docs); LocatorRenderer.Run(docs); var docsString = docs.Values.Select(x => x.Save()); var data = new GenerationData { Namespace = elementsNamespace, XmlDocuments = docsString }; return(_apiClient.GenerateCode(_licenseKey, data)); }