private bool ProcessDTDSubset ()
{
SkipWhitespace ();
int c2 = ReadChar ();
switch(c2)
{
case -1:
return false;
case '%':
// It affects on entity references' well-formedness
if (this.processingInternalSubset)
DTD.InternalSubsetHasPEReference = true;
string peName = ReadName ();
Expect (';');
DTDParameterEntityDeclaration peDecl = GetPEDecl (peName);
if (peDecl == null)
break;
currentInput.PushPEBuffer (peDecl);
// int currentLine = currentInput.LineNumber;
// int currentColumn = currentInput.LinePosition;
while (currentInput.HasPEBuffer)
ProcessDTDSubset ();
SkipWhitespace ();
// FIXME: Implement correct nest-level check.
// Don't depend on lineinfo (might not be supplied)
// if (currentInput.LineNumber != currentLine ||
// currentInput.LinePosition != currentColumn)
// throw NotWFError ("Incorrectly nested parameter entity.");
break;
case '<':
int c = ReadChar ();
switch(c)
{
case '?':
// Only read, no store.
ReadProcessingInstruction ();
break;
case '!':
CompileDeclaration ();
break;
case -1:
throw NotWFError ("Unexpected end of stream.");
default:
throw NotWFError ("Syntax Error after '<' character: " + (char) c);
}
break;
case ']':
if (dtdIncludeSect == 0)
throw NotWFError ("Unbalanced end of INCLUDE/IGNORE section.");
// End of inclusion
Expect ("]>");
dtdIncludeSect--;
SkipWhitespace ();
break;
default:
throw NotWFError (String.Format ("Syntax Error inside doctypedecl markup : {0}({1})", c2, (char) c2));
}
currentInput.AllowTextDecl = false;
return true;
}