예제 #1
0
        /// <summary>
        /// Creates an <c>xsl:apply-templates</c> element.
        /// <code>
        /// &lt;xsl:apply-templates select="<paramref name="select"/>" mode="<paramref name="mode"/>" /&gt;
        /// </code>
        /// </summary>
        /// <param name="select">The select.</param>
        /// <param name="mode">The mode.</param>
        public XsltElement ApplyTemplates(string select, string mode = null)
        {
            var element = new XsltElement(XsltElementType.ApplyTemplates, new XAttribute("select", select));

            element.SetAttributeValue("mode", mode);
            return(element);
        }
예제 #2
0
        /// <summary>
        /// Creates an <c>xsl:template</c> element.
        /// <code>
        /// &lt;xsl:value-of match="<paramref name="match"/>" mode="<paramref name="mode"/>" /&gt;
        /// </code>
        /// </summary>
        /// <param name="match">The match.</param>
        /// <param name="mode">The mode.</param>

        public XsltElement Template(string match, string mode = null)
        {
            var element = new XsltElement(XsltElementType.Template, new XAttribute("match", match));

            element.SetAttributeValue("mode", mode);
            return(element);
        }
예제 #3
0
        /// <summary>
        /// Creates an <c>xsl:output</c> element.
        /// <code>
        /// &lt;xsl:output method="<paramref name="outputMethod"/>" /&gt;
        /// </code>
        /// </summary>
        /// <param name="outputMethod">The output method.</param>
        /// <param name="indent">if set to <c>true</c> [indent].</param>
        public XsltElement Output(OutputMethod outputMethod = OutputMethod.Xml, bool indent = false)
        {
            var element = new XsltElement(XsltElementType.Output,
                                          new XAttribute("method", outputMethod.ToString().ToLower()));

            if (indent)
            {
                element.SetAttributeValue("indent", "yes");
            }
            return(element);
        }