/// <summary>
/// Output doc-type-decl on the first element, and determine whether this element is a
/// CData section element.
/// </summary>
public override void WriteStartElement(string prefix, string localName, string ns)
{
EndCDataSection();
// Output doc-type declaration immediately before first element is output
if (_outputDocType)
{
WriteState ws = _wrapped.WriteState;
if (ws == WriteState.Start || ws == WriteState.Prolog)
{
_wrapped.WriteDocType(
prefix.Length != 0 ? prefix + ":" + localName : localName,
_publicId,
_systemId,
null);
}
_outputDocType = false;
}
_wrapped.WriteStartElement(prefix, localName, ns);
if (_lookupCDataElems != null)
{
// Determine whether this element is a CData section element
_qnameCData.Init(localName, ns);
_bitsCData.PushBit(_lookupCDataElems.ContainsKey(_qnameCData));
}
}