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"); }
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)); }
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); }
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); }