Beispiel #1
0
        public static void AddOrUpdateOutputElements(this XsltElement root, XsltElement outputElement)
        {
            var existingElement = root.FirstOrDefaultXsltElement(outputElement);

            if (existingElement != null)
            {
                existingElement.Add(outputElement.XsltElements());
                return;
            }

            root.AddXsltElement(outputElement);
        }
Beispiel #2
0
 public static XsltElement FirstOrDefaultXsltElement(this XsltElement root, string elementName)
 {
     return(root?.XsltElements().FirstOrDefault(e => e.XsltElementType == XsltElementType.Element &&
                                                e.Attributes()
                                                .Any(a => a.Name == "name" && a.Value == elementName)));
 }