예제 #1
0
 public XsltElement GetKeyElement(IGroup group)
 {
     if (!(group is ISubGroup subgroup))
     {
         return(null);
     }
     return(!subgroup.KeyFields.Any()
         ? null
         : xslt.Key(subgroup.OutputData.Name, subgroup.TemplateMatch, subgroup.GetKeyUse()));
 }
예제 #2
0
        public void Key_String_CreatesElement()
        {
            var xslt  = new XsltFactory();
            var name  = "testName";
            var match = "testMatch";
            var use   = "testUse";
            var key   = xslt.Key(name, match, use);

            Assert.Equal("key", key.Name.LocalName);
            Assert.Contains(key.Attributes(), a => a.Name == "name" && a.Value == name);
            Assert.Contains(key.Attributes(), a => a.Name == "match" && a.Value == match);
            Assert.Contains(key.Attributes(), a => a.Name == "use" && a.Value == use);
        }