/// <summary> /// Add or replace a default attribute for an element type in this schema. /// </summary> /// <param name="elemName"> /// Name (Qname) of the element type /// </param> /// <param name="attrName"> /// Name (Qname) of the attribute /// </param> /// <param name="type"> /// Type of the attribute /// </param> /// <param name="value"> /// Default value of the attribute; null if no default /// </param> public void Attribute(string elemName, string attrName, string type, string value) { ElementType e = GetElementType(elemName); if (e == null) { throw new Exception("Attribute " + attrName + " specified for unknown element type " + elemName); } e.SetAttribute(attrName, type, value); }
/// <summary> /// Set an attribute and its value into this element. /// </summary> /// <param name="name"> /// The attribute name (Qname) /// </param> /// <param name="type"> /// The attribute type /// </param> /// <param name="value"> /// The attribute value /// </param> public void SetAttribute(string name, string type, string value) { _type.SetAttribute(_atts, name, type, value); }