private XmlDocumentType LoadDocumentTypeNode()
{
Debug.Assert(_reader.NodeType == XmlNodeType.DocumentType);
String publicId = null;
String systemId = null;
String internalSubset = _reader.Value;
String localName = _reader.LocalName;
while (_reader.MoveToNextAttribute())
{
switch (_reader.Name)
{
case "PUBLIC":
publicId = _reader.Value;
break;
case "SYSTEM":
systemId = _reader.Value;
break;
}
}
XmlDocumentType dtNode = _doc.CreateDocumentType(localName, publicId, systemId, internalSubset);
IDtdInfo dtdInfo = _reader.DtdInfo;
if (dtdInfo != null)
LoadDocumentType(dtdInfo, dtNode);
else
{
//construct our own XmlValidatingReader to parse the DocumentType node so we could get Entities and notations information
ParseDocumentType(dtNode);
}
return dtNode;
}