private void ProcessAppInfoDocMarkup(bool root)
{
//First time reader is positioned on AppInfo or Documentation element
XmlNode currentNode = null;
switch (_reader.NodeType)
{
case XmlNodeType.Element:
_annotationNSManager.PushScope();
currentNode = LoadElementNode(root);
// Dev10 (TFS) #479761: The following code was to address the issue of where an in-scope namespace delaration attribute
// was not added when an element follows an empty element. This fix will result in persisting schema in a consistent form
// although it does not change the semantic meaning of the schema.
// Since it is as a breaking change and Dev10 needs to maintain the backward compatibility, this fix is being reverted.
// if (reader.IsEmptyElement) {
// annotationNSManager.PopScope();
// }
break;
case XmlNodeType.Text:
currentNode = _dummyDocument.CreateTextNode(_reader.Value);
goto default;
case XmlNodeType.SignificantWhitespace:
currentNode = _dummyDocument.CreateSignificantWhitespace(_reader.Value);
goto default;
case XmlNodeType.CDATA:
currentNode = _dummyDocument.CreateCDataSection(_reader.Value);
goto default;
case XmlNodeType.EntityReference:
currentNode = _dummyDocument.CreateEntityReference(_reader.Name);
goto default;
case XmlNodeType.Comment:
currentNode = _dummyDocument.CreateComment(_reader.Value);
goto default;
case XmlNodeType.ProcessingInstruction:
currentNode = _dummyDocument.CreateProcessingInstruction(_reader.Name, _reader.Value);
goto default;
case XmlNodeType.EndEntity:
break;
case XmlNodeType.Whitespace:
break;
case XmlNodeType.EndElement:
_annotationNSManager.PopScope();
_parentNode = _parentNode.ParentNode;
break;
default: //other possible node types: Document/DocType/DocumentFrag/Entity/Notation/Xmldecl cannot appear as children of xs:appInfo or xs:doc
Debug.Assert(currentNode != null);
Debug.Assert(_parentNode != null);
_parentNode.AppendChild(currentNode);
break;
}
}