private string m_literalValue; // the attribute value /// <summary> /// Attribute objects are reused during parsing to reduce memory allocations, /// hence the Reset method. /// </summary> public void Reset(string name, string value, char quote) { this.Name = name; this.m_literalValue = value; this.QuoteChar = quote; this.DtdType = null; }
private string _literalValue; // the attribute value /// <summary> /// Attribute objects are reused during parsing to reduce memory allocations, /// hence the Reset method. /// </summary> public void Reset(string name, string value, char quote) { Name = name; _literalValue = value; QuoteChar = quote; DtdType = null; }
/// <summary> /// Attribute objects are reused during parsing to reduce memory allocations, /// hence the Reset method. /// </summary> public void Reset( string name, string value, char quote ) { Name = name; _literalValue = value; QuoteChar = quote; DtdType = null; }
/// <summary> /// Attribute objects are reused during parsing to reduce memory allocations, /// hence the Reset method. /// </summary> public void Reset(string name, string value, char quote) { this.Name = name; this.m_literalValue = value; this.QuoteChar = quote; this.DtdType = null; }
void ParseAttType( char ch, AttDef attdef ) { if( ch == '%' ) { var e = ParseParameterEntity( WhiteSpace ); PushEntity( _current.ResolvedUri, e ); ParseAttType( _current.Lastchar, attdef ); PopEntity(); // bugbug - are we at the end of the entity? return; } if( ch == '(' ) { attdef.SetEnumeratedType( ParseNameGroup( ch, false ), AttributeType.ENUMERATION ); } else { var token = ScanName( WhiteSpace ); if( token.EqualsIgnoreCase( "NOTATION" ) ) { ch = _current.SkipWhitespace(); if( ch != '(' ) { _current.Error( "Expecting name group '(', but found '{0}'", ch ); } attdef.SetEnumeratedType( ParseNameGroup( ch, true ), AttributeType.NOTATION ); } else { attdef.SetType( token ); } } }
void ParseAttDefault( char ch, AttDef attdef ) { if( ch == '%' ) { var e = ParseParameterEntity( WhiteSpace ); PushEntity( _current.ResolvedUri, e ); ParseAttDefault( _current.Lastchar, attdef ); PopEntity(); // bugbug - are we at the end of the entity? return; } var hasdef = true; if( ch == '#' ) { _current.ReadChar(); var token = _current.ScanToken( _sb, WhiteSpace, true ); hasdef = attdef.SetPresence( token ); ch = _current.SkipWhitespace(); } if( !hasdef ) return; if( ch == '\'' || ch == '"' ) { var lit = _current.ScanLiteral( _sb, ch ); attdef.Default = lit; _current.SkipWhitespace(); } else { var name = _current.ScanToken( _sb, WhiteSpace, false ); name = name.ToUpperInvariant(); attdef.Default = name; // bugbug - must be one of the enumerated names. _current.SkipWhitespace(); } }
AttDef ParseAttDef() { var name = ScanName( WhiteSpace ); name = name.ToUpperInvariant(); var attdef = new AttDef( name ); var ch = _current.SkipWhitespace(); if( ch == '-' ) ch = ParseDeclComments(); ParseAttType( ch, attdef ); ch = _current.SkipWhitespace(); if( ch == '-' ) ch = ParseDeclComments(); ParseAttDefault( ch, attdef ); ch = _current.SkipWhitespace(); if( ch == '-' ) ParseDeclComments(); return attdef; }