示例#1
0
        public void ApplyTemplates_SelectStringOnly_CreatesElementWithoutModeAttribute()
        {
            var xslt           = new XsltFactory();
            var select         = "testSelect";
            var applyTemplates = xslt.ApplyTemplates(select);

            Assert.Equal("apply-templates", applyTemplates.Name.LocalName);
            Assert.Contains(applyTemplates.Attributes(), a => a.Name == "select" && a.Value == select);
            Assert.DoesNotContain(applyTemplates.Attributes(), a => a.Name == "mode");
        }
示例#2
0
        private XsltElement GetApplyTemplatesElement(string context, IGroup childGroup)
        {
            if (!(childGroup is ISubGroup subGroup))
            {
                return(null);
            }
            var mode   = subGroup.OutputData.Name;
            var select = GetMuenchianGrouping(context, mode, subGroup.GetKeyUse());

            return(xslt.ApplyTemplates(select, mode));
        }
示例#3
0
        public void ApplyTemplates_SelectAndMode_CreatesElementWithModeAttribute()
        {
            var xslt           = new XsltFactory();
            var select         = "testSelect";
            var mode           = "testMode";
            var applyTemplates = xslt.ApplyTemplates(select, mode);

            Assert.Equal("apply-templates", applyTemplates.Name.LocalName);
            Assert.Contains(applyTemplates.Attributes(), a => a.Name == "select" && a.Value == select);
            Assert.Contains(applyTemplates.Attributes(), a => a.Name == "mode" && a.Value == mode);
        }
示例#4
0
        public XElement CreateTemplateCopy()
        {
            var copyArg         = "@*|node()";
            var templateElement = xslt.Template(copyArg);
            var copyElement     = xslt.Copy();

            copyElement.Add(xslt.ApplyTemplates(copyArg));
            templateElement.Add(copyElement);

            return(templateElement);
        }