XmlBufferedReader
An xml reader that has a buffer that allows peeking events as well as injecting events into the stream. Note that this class does not do any validation of the xml. If injecting/removing elements into/from the buffer you can create invalid XML.
Parameters
The underlying reader to read from.
Properties
The declared encoding for the document. Unlike general parsing, this value is accessible after reading the document element. The document element must be the first non-whitespace element. The value for this property before document element presence is known is implementation defined (and may change).
Are we peeking (is the underlying buffer ahead)
The current namespace context
The declared standalone status for the document. Unlike general parsing, this value is accessible after reading the document element. The document element must be the first non-whitespace element. The value for this property before document element presence is known is implementation defined (and may change).
The declared xml version for the document. Unlike general parsing, this value is accessible after reading the document element. The document element must be the first non-whitespace element. The value for this property before document element presence is known is implementation defined (and may change).
Functions
Consume all text and non-content (comment/processing instruction) to get an uninterrupted text sequence. This will skip over comments but not ignorable whitespace that starts the string, but not tags. Any tags encountered will lead to a return of this function. Any tags encountered with cause an exception to be thrown. It can either be invoked when in a start tag to return all text content, or on a content element to include it (if text or cdata) and all subsequent siblings.
Get the next text sequence in the reader. This will skip over comments and ignorable whitespace (starting the content), but not tags. Any tags encountered with cause an exception to be thrown. It can either be invoked when in a start tag to return all text content, or on a content element to include it (if text or cdata) and all subsequent siblings.
Consume all text and non-content (comment/processing instruction) to get an uninterrupted text sequence. This will skip over comments and ignorable whitespace that starts the string, but not tags. Any tags encountered will lead to a return of this function. Any tags encountered with cause an exception to be thrown. It can either be invoked when in a start tag to return all text content, or on a content element to include it (if text or cdata) and all subsequent siblings.
Differs from .siblingsToFragment in that it skips the current event.
Read the current element (and content) only into a fragment.
Is the currrent element character content
Check that the current state is a start element for the given name. The mPrefix is ignored.
Is the current element a start element
Peek the next event only (this doesn't give access to the peeked information.
Put the current element in the peek buffer. This is basically a very limited pushback
From a start tag read the text only content of the element. Comments are allowed and handled, but subtags are not allowed. This tag finishes at the end of the element.
Read the current element (and content) and all its siblings into a fragment.
From a start element, skip all element content until the corresponding end element has been read. After invocation the end element has just been read (and would be returned on relevant state calls).
Skil the preamble events in the stream reader
Write the current event to the writer. This will not move the reader.