public SetPresence ( string token ) : bool | ||
token | string | The string representation of the attribute presence, corresponding to one of the values in the |
리턴 | bool |
void ParseAttDefault(char ch, AttDef attdef) { if (ch == '%') { Entity e = ParseParameterEntity(SgmlDtd.WhiteSpace); PushEntity(this.m_current.ResolvedUri, e); ParseAttDefault(this.m_current.Lastchar, attdef); PopEntity(); // bugbug - are we at the end of the entity? ch = this.m_current.Lastchar; return; } bool hasdef = true; if (ch == '#') { this.m_current.ReadChar(); string token = this.m_current.ScanToken(this.m_sb, SgmlDtd.WhiteSpace, true); hasdef = attdef.SetPresence(token); ch = this.m_current.SkipWhitespace(); } if (hasdef) { if (ch == '\'' || ch == '"') { string lit = this.m_current.ScanLiteral(this.m_sb, ch); attdef.Default = lit; ch = this.m_current.SkipWhitespace(); } else { string name = this.m_current.ScanToken(this.m_sb, SgmlDtd.WhiteSpace, false); name = name.ToUpperInvariant(); attdef.Default = name; // bugbug - must be one of the enumerated names. ch = this.m_current.SkipWhitespace(); } } }
void ParseAttDefault(char ch, AttDef attdef) { if (ch == '%') { Entity e = ParseParameterEntity(_ws); PushEntity(_current.ResolvedUri, e); ParseAttDefault(_current.Lastchar, attdef); PopEntity(); // bugbug - are we at the end of the entity? ch = _current.Lastchar; return; } bool hasdef = true; if (ch == '#') { _current.ReadChar(); string token = _current.ScanToken(_sb, _ws, true); hasdef = attdef.SetPresence(token); ch = _current.SkipWhitespace(); } if (hasdef) { if (ch == '\'' || ch == '"') { string lit = _current.ScanLiteral(_sb, ch); attdef.Default = lit; ch = _current.SkipWhitespace(); } else { string name = _current.ScanToken(_sb, _ws, false); name = _nt.Add(name.ToLower()); attdef.Default = name; // bugbug - must be one of the enumerated names. ch = _current.SkipWhitespace(); } } }