public override void WriteStartElement(string prefix, string localName, string ns) {
EndCDataSection();
if (this.checkWellFormedDoc) {
// Don't allow multiple document elements
if (this.depth == 0 && this.hasDocElem)
throw new XmlException(Res.Xml_NoMultipleRoots, string.Empty);
this.depth++;
this.hasDocElem = true;
}
// Output doc-type declaration immediately before first element is output
if (this.outputDocType) {
this.wrapped.WriteDocType(
prefix.Length != 0 ? prefix + ":" + localName : localName,
this.publicId,
this.systemId,
null);
this.outputDocType = false;
}
this.wrapped.WriteStartElement(prefix, localName, ns);
if (this.lookupCDataElems != null) {
// Determine whether this element is a CData section element
this.qnameCData.Init(localName, ns);
this.bitsCData.PushBit(this.lookupCDataElems[this.qnameCData] != null);
}
}