private void CloseWithAppendAttribute() {
XmlElement elem = start as XmlElement;
Debug.Assert(elem != null);
XmlAttributeCollection attrs = elem.Attributes;
for (int i = 0; i < fragment.Count; i++) {
XmlAttribute attr = fragment[i] as XmlAttribute;
Debug.Assert(attr != null);
int offset = attrs.FindNodeOffsetNS(attr);
if (offset != -1
&& ((XmlAttribute)attrs.Nodes[offset]).Specified) {
throw new XmlException(Res.Xml_DupAttributeName, attr.Prefix.Length == 0 ? attr.LocalName : string.Concat(attr.Prefix, ":", attr.LocalName));
}
}
for (int i = 0; i < fragment.Count; i++) {
XmlAttribute attr = fragment[i] as XmlAttribute;
Debug.Assert(attr != null);
attrs.Append(attr);
}
}