Mono.Xml.DTDValidatingReader.ReadDoctype C# (CSharp) Method

ReadDoctype() public method

public ReadDoctype ( ) : void
return void
		void ReadDoctype ()
		{
			FillAttributes ();

			IHasXmlParserContext ctx = reader as IHasXmlParserContext;
			if (ctx != null)
				dtd = ctx.ParserContext.Dtd;
			if (dtd == null) {
				XmlTextReaderImpl xmlTextReader = new XmlTextReaderImpl ("", XmlNodeType.Document, null);
				xmlTextReader.XmlResolver = resolver;
				xmlTextReader.GenerateDTDObjectModel (reader.Name,
					reader ["PUBLIC"], reader ["SYSTEM"], reader.Value);
				dtd = xmlTextReader.DTD;
			}
			currentAutomata = dtd.RootAutomata;

			// Validity Constraint Check.
			for (int i = 0; i < DTD.Errors.Length; i++)
				HandleError (DTD.Errors [i].Message, XmlSeverityType.Error);

			// NData target exists.
			foreach (DTDEntityDeclaration ent in dtd.EntityDecls.Values)
				if (ent.NotationName != null && dtd.NotationDecls [ent.NotationName] == null)
					this.HandleError ("Target notation was not found for NData in entity declaration " + ent.Name + ".",
						XmlSeverityType.Error);
			// NOTATION exists for attribute default values
			foreach (DTDAttListDeclaration attListIter in dtd.AttListDecls.Values) {
				foreach (DTDAttributeDefinition def in attListIter.Definitions) {
					if (def.Datatype.TokenizedType != XmlTokenizedType.NOTATION)
						continue;
					foreach (string notation in def.EnumeratedNotations)
						if (dtd.NotationDecls [notation] == null)
							this.HandleError ("Target notation was not found for NOTATION typed attribute default " + def.Name + ".",
								XmlSeverityType.Error);
				}
			}
		}