/// <summary> /// More http://www.w3.org/TR/REC-xml/#sec-pi. /// </summary> /// <param name="pi">The processing instruction token.</param> XmlToken ProcessingContent(XmlPIToken pi) { var c = GetNext(); while (c != Symbols.EndOfFile) { if (c == Symbols.QuestionMark) { c = GetNext(); if (c == Symbols.GreaterThan) { pi.Content = FlushBuffer(); return(pi); } StringBuffer.Append(Symbols.QuestionMark); } else { StringBuffer.Append(c); c = GetNext(); } } throw XmlParseError.EOF.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#sec-pi. /// </summary> /// <param name="c">The next input character.</param> /// <param name="pi">The processing instruction token.</param> XmlToken ProcessingTarget(Char c, XmlPIToken pi) { while (c.IsXmlName()) { StringBuffer.Append(c); c = GetNext(); } pi.Target = FlushBuffer(); if (pi.Target.Isi(TagNames.Xml)) { throw XmlParseError.XmlInvalidPI.At(GetCurrentPosition()); } if (c == Symbols.QuestionMark) { c = GetNext(); if (c == Symbols.GreaterThan) { return(pi); } } else if (c.IsSpaceCharacter()) { return(ProcessingContent(pi)); } throw XmlParseError.XmlInvalidPI.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#sec-pi. /// </summary> /// <param name="c">The next input character.</param> /// <param name="pi">The processing instruction token.</param> XmlToken ProcessingTarget(Char c, XmlPIToken pi) { while (c.IsXmlName()) { _stringBuffer.Append(c); c = GetNext(); } pi.Target = FlushBuffer(); if (String.Compare(pi.Target, Tags.Xml, StringComparison.OrdinalIgnoreCase) == 0) throw XmlParseError.XmlInvalidPI.At(GetCurrentPosition()); if (c == Symbols.QuestionMark) { c = GetNext(); if (c == Symbols.GreaterThan) return pi; } else if (c.IsSpaceCharacter()) return ProcessingContent(GetNext(), pi); throw XmlParseError.XmlInvalidPI.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#sec-pi. /// </summary> /// <param name="c">The next input character.</param> /// <param name="pi">The processing instruction token.</param> XmlToken ProcessingContent(Char c, XmlPIToken pi) { while (c != Symbols.EndOfFile) { if (c == Symbols.QuestionMark) { c = GetNext(); if (c == Symbols.GreaterThan) { pi.Content = FlushBuffer(); return pi; } _stringBuffer.Append(Symbols.QuestionMark); } else { _stringBuffer.Append(c); c = GetNext(); } } throw XmlParseError.EOF.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#sec-pi. /// </summary> /// <param name="c">The next input character.</param> /// <param name="pi">The processing instruction token.</param> XmlToken ProcessingTarget(Char c, XmlPIToken pi) { while (c.IsXmlName()) { _stringBuffer.Append(c); c = GetNext(); } pi.Target = FlushBuffer(); if (pi.Target.Isi(TagNames.Xml)) throw XmlParseError.XmlInvalidPI.At(GetCurrentPosition()); if (c == Symbols.QuestionMark) { c = GetNext(); if (c == Symbols.GreaterThan) return pi; } else if (c.IsSpaceCharacter()) return ProcessingContent(GetNext(), pi); throw XmlParseError.XmlInvalidPI.At(GetCurrentPosition()); }