Parser.ParserBase.CreateTagXmlNode C# (CSharp) Method

CreateTagXmlNode() protected method

Creates an xml node for the specified tag.
protected CreateTagXmlNode ( TagBase tag ) : XmlNode
tag TagBase
return System.Xml.XmlNode
        protected XmlNode CreateTagXmlNode(TagBase tag)
        {
            #region Check the arguments

            if (tag == null)
                throw new ArgumentNullException();

            #endregion

            CheckXmlDocInitialized();

            XmlElement myTagNode = fParsedDocument.CreateElement(cTagXmlNodeName);

            XmlAttribute myTypeAttribute = fParsedDocument.CreateAttribute(cTagTypeXmlAttributeName);
            myTypeAttribute.Value = tag.Type;
            myTagNode.Attributes.Append(myTypeAttribute);

            if (tag.Value != null)
            {
                XmlAttribute myValueAttribute = fParsedDocument.CreateAttribute(cValueXmlAttributeName);
                myValueAttribute.Value = tag.Value;
                myTagNode.Attributes.Append(myValueAttribute);
            }

            return myTagNode;
        }