Ejemplo n.º 1
0
        // ====================================================================
        //
        //  PRIVATE/PROTECTED METHODS
        //
        // ====================================================================
        private void CheckTag()
        {
            if (TagName.EndsWith("/"))
            {
                TagName = TagName.Substring(0, TagName.Length - 1);
            }
            TagNameNS = TagName;

            ElementInfo = HtmlElementInfo.GetElementInfo(TagNameNS);

            int pos = TagName.IndexOf(':');

            if (pos != -1)
            {
                Namespace = TagName.Substring(0, pos);
                TagName   = TagName.Substring(pos + 1);
            }
            if (ElementInfo == null)
            {
                if (Namespace == null)
                {
                    AddWarning("Unknown tag: " + TagName);
                }
            }
            else
            {
                if (Parent != null)
                {
                    if (!ElementInfo.IsValidParent(Parent.TagName))
                    {
                        AddWarning("Invalid parent for " + TagName + " (parent: " + Parent.TagName + ")");
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static string BuildOpenTag(string tagName, List <Tuple <string, string> > attributes, bool noEvents, bool noUnknownAttributes)
        {
            HtmlElementInfo ei = null;

            if (noUnknownAttributes)
            {
                ei = HtmlElementInfo.GetElementInfo(tagName);
            }
            return(InternalBuildOpenTag(ei, tagName, attributes, noEvents, noUnknownAttributes, false));
        }