System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartAttribute C# (CSharp) Method

WriteStartAttribute() public method

Before calling XmlRawWriter.WriteStartAttribute(), perform various checks to ensure well-formedness.
public WriteStartAttribute ( string prefix, string localName, string ns ) : void
prefix string
localName string
ns string
return void
        public override void WriteStartAttribute(string prefix, string localName, string ns) {
            Debug.Assert(prefix != null && localName != null && ns != null, "Invalid argument");

            if (prefix.Length == 5 && prefix == "xmlns") {
                // Handle namespace attributes that are not sent directly to WriteNamespaceDeclaration
                WriteStartNamespace(localName);
            }
            else {
                // All other attributes
                Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Attribute, ValidateNames.Flags.All));

                // Xml state transitions
                ConstructInEnumAttrs(XPathNodeType.Attribute);

                // Check for prefix conflicts and possibly declare prefix
                if (ns.Length != 0 && this.depth != 0)
                    prefix = CheckAttributePrefix(prefix, ns);

                // Output the attribute
                WriteStartAttributeUnchecked(prefix, localName, ns);
            }
        }