Ejemplo n.º 1
0
        /// <summary>
        /// News the XML node.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="notetext">The notetext.</param>
        /// <param name="type">The type.</param>
        private void NewXmlNode(string id, string notetext, FootnoteType type)
        {
            this.Node = this.Document.CreateNode("note", "text");

            XmlAttribute xa = this.Document.CreateAttribute("id", "text");

            xa.Value = "ftn" + id;
            this.Node.Attributes.Append(xa);

            xa       = this.Document.CreateAttribute("note-class", "text");
            xa.Value = type.ToString();
            this.Node.Attributes.Append(xa);

            //Node citation
            XmlNode node = this.Document.CreateNode("not-citation", "text");

            node.InnerText = id;

            this._node.AppendChild(node);

            //Node Footnode body
            XmlNode nodebody = this.Document.CreateNode("note-body", "text");

            //Node Footnode text
            node          = this.Document.CreateNode("p", "text");
            node.InnerXml = notetext;

            xa       = this.Document.CreateAttribute("style-name", "text");
            xa.Value = (type == FootnoteType.footnode)?"Footnote":"Endnote";
            node.Attributes.Append(xa);

            nodebody.AppendChild(node);

            this._node.AppendChild(nodebody);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Footnote"/> class.
        /// </summary>
        /// <param name="document">The text document.</param>
        /// <param name="notetext">The notetext.</param>
        /// <param name="id">The id.</param>
        /// <param name="type">The type.</param>
        public Footnote(IDocument document, string notetext, string id, FootnoteType type)
        {
            Document = document;
            Node     = new XElement(Ns.Text + "note");

            XAttribute xa = new XAttribute(Ns.Text + "id", "ftn" + id);

            Node.Add(xa);

            xa = new XAttribute(Ns.Text + "note-class", type.ToString());
            Node.Add(xa);

            //Node citation
            XElement node = new XElement(Ns.Text + "note-citation", id);

            Node.Add(node);

            //Node Footnode body
            XElement nodebody = new XElement(Ns.Text + "note-body");

            //Node Footnode text
            node = new XElement(Ns.Text + "p", notetext);

            xa = new XAttribute(Ns.Text + "style-name", (type == FootnoteType.Footnode) ? "Footnote" : "Endnote");
            node.Add(xa);

            nodebody.Add(node);

            Node.Add(nodebody);
            InitStandards();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// News the XML node.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="notetext">The notetext.</param>
        /// <param name="type">The type.</param>
        private void NewXmlNode(string id, string notetext, FootnoteType type)
        {
            this.Node		= this.Document.CreateNode("note", "text");

            XmlAttribute xa = this.Document.CreateAttribute("id", "text");
            xa.Value		= "ftn"+id;
            this.Node.Attributes.Append(xa);

            xa				 = this.Document.CreateAttribute("note-class", "text");
            xa.Value		= type.ToString();
            this.Node.Attributes.Append(xa);

            //Node citation
            XmlNode node	 = this.Document.CreateNode("not-citation", "text");
            node.InnerText	 = id;

            this._node.AppendChild(node);

            //Node Footnode body
            XmlNode nodebody = this.Document.CreateNode("note-body", "text");

            //Node Footnode text
            node			 = this.Document.CreateNode("p", "text");
            node.InnerXml	 = notetext;

            xa				 = this.Document.CreateAttribute("style-name", "text");
            xa.Value		 = (type == FootnoteType.footnode)?"Footnote":"Endnote";
            node.Attributes.Append(xa);

            nodebody.AppendChild(node);

            this._node.AppendChild(nodebody);
        }