private DTDAttListDeclaration ReadAttListDecl ()
{
TryExpandPERefSpaceKeep ();
if (!SkipWhitespace ())
throw NotWFError ("Whitespace is required between ATTLIST and name in DTD attlist declaration.");
TryExpandPERef ();
string name = ReadName (); // target element name
DTDAttListDeclaration decl =
DTD.AttListDecls [name] as DTDAttListDeclaration;
if (decl == null)
decl = new DTDAttListDeclaration (DTD);
decl.IsInternalSubset = this.processingInternalSubset;
decl.Name = name;
if (!SkipWhitespace ())
if (PeekChar () != '>')
throw NotWFError ("Whitespace is required between name and content in non-empty DTD attlist declaration.");
TryExpandPERef ();
while (XmlChar.IsNameChar (PeekChar ())) {
DTDAttributeDefinition def = ReadAttributeDefinition ();
// There must not be two or more ID attributes.
if (def.Datatype.TokenizedType == XmlTokenizedType.ID) {
for (int i = 0; i < decl.Definitions.Count; i++) {
DTDAttributeDefinition d = decl [i];
if (d.Datatype.TokenizedType == XmlTokenizedType.ID) {
HandleError (new XmlSchemaException ("AttList declaration must not contain two or more ID attributes.",
def.LineNumber, def.LinePosition, null, def.BaseURI, null));
break;
}
}
}
if (decl [def.Name] == null)
decl.Add (def);
SkipWhitespace ();
TryExpandPERef ();
}
SkipWhitespace ();
// This expanding is only allowed as a non-validating parser.
TryExpandPERef ();
Expect ('>');
return decl;
}