void Consume(DtdToken token) { switch (token.Type) { case DtdTokenType.Attribute: _result.AddAttribute(((DtdAttributeToken)token).ToElement()); break; case DtdTokenType.Comment: _result.AddComment(((DtdCommentToken)token).ToElement()); break; case DtdTokenType.Element: _result.AddElement(((DtdElementToken)token).ToElement()); break; case DtdTokenType.Entity: _result.AddEntity(((DtdEntityToken)token).ToElement()); break; case DtdTokenType.Notation: _result.AddNotation(((DtdNotationToken)token).ToElement()); break; case DtdTokenType.ProcessingInstruction: _result.AddProcessingInstruction(((DtdPIToken)token).ToElement()); break; } }
/// <summary> /// Adds the given entity to the DTD container. /// </summary> /// <param name="token">The entity token to add.</param> void AddEntity(DtdEntityToken token) { if (token.IsExtern) { token.Value = GetText(token.SystemIdentifier); } if (token.IsParameter) { _result.AddParameter(token.ToElement()); } else { _result.AddEntity(token.ToElement()); } }