/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-Attribute. /// </summary> /// <param name="tag">The current tag token.</param> /// <param name="quote">The quote character.</param> XmlToken AttributeValue(XmlTagToken tag, Char quote) { var c = GetNext(); while (c != quote) { if (c == Symbols.EndOfFile) { throw XmlParseError.EOF.At(GetCurrentPosition()); } if (c == Symbols.Ampersand) { StringBuffer.Append(CharacterReference()); } else if (c == Symbols.LessThan) { throw XmlParseError.XmlLtInAttributeValue.At(GetCurrentPosition()); } else { StringBuffer.Append(c); } c = GetNext(); } tag.SetAttributeValue(FlushBuffer()); return(AttributeAfterValue(tag)); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-Attribute. /// </summary> /// <param name="c">The next input character.</param> /// <param name="q">The quote character.</param> /// <param name="tag">The current tag token.</param> XmlToken AttributeValue(Char c, Char q, XmlTagToken tag) { while (c != q) { if (c == Symbols.EndOfFile) { throw XmlParseError.EOF.At(GetCurrentPosition()); } if (c == Symbols.Ampersand) { _stringBuffer.Append(CharacterReference(GetNext()).GetEntity()); } else if (c == Symbols.LessThan) { throw XmlParseError.XmlLtInAttributeValue.At(GetCurrentPosition()); } else { _stringBuffer.Append(c); } c = GetNext(); } tag.SetAttributeValue(_stringBuffer.ToString()); return(AttributeAfterValue(GetNext(), tag)); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-Attribute. /// </summary> /// <param name="c">The next input character.</param> /// <param name="q">The quote character.</param> /// <param name="tag">The current tag token.</param> XmlToken AttributeValue(Char c, Char q, XmlTagToken tag) { while (c != q) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); if (c == Symbols.Ampersand) _stringBuffer.Append(CharacterReference(GetNext())); else if (c == Symbols.LessThan) throw XmlParseError.XmlLtInAttributeValue.At(GetCurrentPosition()); else _stringBuffer.Append(c); c = GetNext(); } tag.SetAttributeValue(FlushBuffer()); return AttributeAfterValue(GetNext(), tag); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-Attribute. /// </summary> /// <param name="c">The next input character.</param> /// <param name="q">The quote character.</param> /// <param name="tag">The current tag token.</param> XmlToken AttributeValue(Char c, Char q, XmlTagToken tag) { while (c != q) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); if (c == Symbols.Ampersand) _stringBuffer.Append(CharacterReference(GetNext())); else if (c == Symbols.LessThan) throw XmlParseError.XmlLtInAttributeValue.At(GetCurrentPosition()); else _stringBuffer.Append(c); c = GetNext(); } tag.SetAttributeValue(FlushBuffer()); return AttributeAfterValue(GetNext(), tag); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-Attribute. /// </summary> /// <param name="tag">The current tag token.</param> /// <param name="quote">The quote character.</param> private XmlToken AttributeValue(XmlTagToken tag, Char quote) { var c = GetNext(); while (c != quote) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); if (c == Symbols.LessThan) throw XmlParseError.XmlLtInAttributeValue.At(GetCurrentPosition()); if (c == Symbols.Ampersand) { StringBuffer.Append(CharacterReference()); } else { StringBuffer.Append(c); } c = GetNext(); } tag.SetAttributeValue(FlushBuffer()); return AttributeAfterValue(tag); }