コード例 #1
0
        /// <summary>
        /// Creates an xml document for hashing results from hash or search.
        /// </summary>
        /// <returns>created xml node</returns>
        private void CreateStartXml()
        {
            if (this.v_configuration != null)
            {
                StringBuilder sb        = new StringBuilder();
                StringBuilder structure = new StringBuilder();

                string rootname = ((IXmlLayoutConfiguration)this.v_configuration).Rootnode;
                string lognode  = ((IXmlLayoutConfiguration)this.v_configuration).Lognode;

                string headernode = CreateXmlNode("header", null, true, this.v_configuration.Header, false);
                Header = headernode;
                string footernode = CreateXmlNode("footer", null, true, this.v_configuration.Footer, false);
                Footer = footernode;

                sb.AppendLine(headernode);

                string itemroot = CreateXmlNode(rootname, (Hashtable)this.v_configuration.Parameters["rootnode"], true, sb.ToString(), true);
                itemroot = itemroot.Replace(string.Format("</{0}>", rootname), string.Empty);

                ITokenizer t = Tokenizer.CreateTokenizer(itemroot);
                itemroot = t.Format(null);

                structure.AppendLine(CreateHeader());
                structure.AppendLine(itemroot);

                v_startvalue = structure.ToString().TrimEnd('\n', '\r');
                v_endvalue   = string.Format("{0}{1}</{2}>", footernode, System.Environment.NewLine, rootname);
            }
        }