private DTDNotationDeclaration ReadNotationDecl()
{
DTDNotationDeclaration decl = new DTDNotationDeclaration (DTD);
if (!SkipWhitespace ())
throw NotWFError ("Whitespace is required between NOTATION and name in DTD notation declaration.");
TryExpandPERef ();
decl.Name = ReadName (); // notation name
/*
if (namespaces) { // copy from SetProperties ;-)
int indexOfColon = decl.Name.IndexOf (':');
if (indexOfColon == -1) {
decl.Prefix = String.Empty;
decl.LocalName = decl.Name;
} else {
decl.Prefix = decl.Name.Substring (0, indexOfColon);
decl.LocalName = decl.Name.Substring (indexOfColon + 1);
}
} else {
*/
decl.Prefix = String.Empty;
decl.LocalName = decl.Name;
// }
SkipWhitespace ();
if(PeekChar () == 'P') {
decl.PublicId = ReadPubidLiteral ();
bool wsSkipped = SkipWhitespace ();
if (PeekChar () == '\'' || PeekChar () == '"') {
if (!wsSkipped)
throw NotWFError ("Whitespace is required between public id and system id.");
decl.SystemId = ReadSystemLiteral (false);
SkipWhitespace ();
}
} else if(PeekChar () == 'S') {
decl.SystemId = ReadSystemLiteral (true);
SkipWhitespace ();
}
if(decl.PublicId == null && decl.SystemId == null)
throw NotWFError ("public or system declaration required for \"NOTATION\" declaration.");
// This expanding is only allowed as a non-validating parser.
TryExpandPERef ();
Expect ('>');
return decl;
}