Sgml.ElementDecl.CanContain C# (CSharp) Method

CanContain() public method

Tests whether this element can contain another specified element.
public CanContain ( string name, SgmlDtd dtd ) : bool
name string The name of the element to check for.
dtd SgmlDtd The DTD to use to do the check.
return bool
        public bool CanContain(string name, SgmlDtd dtd)
        {            
            // return true if this element is allowed to contain the given element.
            if (m_exclusions != null) 
            {
                foreach (string s in m_exclusions) 
                {
                    if (string.Equals(s, name, StringComparison.OrdinalIgnoreCase))
                        return false;
                }
            }

            if (m_inclusions != null) 
            {
                foreach (string s in m_inclusions) 
                {
                    if (string.Equals(s, name, StringComparison.OrdinalIgnoreCase))
                        return true;
                }
            }
            return m_contentModel.CanContain(name, dtd);
        }
    }