System.Xml.Schema.XsdBuilder.ProcessAttribute C# (CSharp) Method

ProcessAttribute() private method

private ProcessAttribute ( string prefix, string name, string ns, string value ) : void
prefix string
name string
ns string
value string
return void
        internal override void ProcessAttribute(string prefix, string name, string ns, string value)
        {
            XmlQualifiedName qname = new XmlQualifiedName(name, ns);
            if (_currentEntry.Attributes != null)
            {
                for (int i = 0; i < _currentEntry.Attributes.Length; i++)
                {
                    XsdAttributeEntry a = _currentEntry.Attributes[i];
                    if (_schemaNames.TokenToQName[(int)a.Attribute].Equals(qname))
                    {
                        try
                        {
                            a.BuildFunc(this, value);
                        }
                        catch (XmlSchemaException e)
                        {
                            e.SetSource(_reader.BaseURI, _positionInfo.LineNumber, _positionInfo.LinePosition);
                            SendValidationEvent(SR.Sch_InvalidXsdAttributeDatatypeValue, new string[] { name, e.Message }, XmlSeverityType.Error);
                        }
                        return;
                    }
                }
            }

            // Check non-supported attribute
            if ((ns != _schemaNames.NsXs) && (ns.Length != 0))
            {
                if (ns == _schemaNames.NsXmlNs)
                {
                    if (_namespaces == null)
                    {
                        _namespaces = new Dictionary<string, string>();
                    }
                    _namespaces.Add((name == _schemaNames.QnXmlNs.Name) ? string.Empty : name, value);
                }
                else
                {
                    XmlAttribute attribute = new XmlAttribute(prefix, name, ns, _schema.Document);
                    attribute.Value = value;
                    _unhandledAttributes.Add(attribute);
                }
            }
            else
            {
                SendValidationEvent(SR.Sch_UnsupportedAttribute, qname.ToString());
            }
        }
XsdBuilder