A org.codehaus.stax2.ri.evt.StartDocumentEventImpl instance is constructed from the values in a XMLStreamReader instance.
The member variable mEncodingScheme is set from the reader-function #getCharacterEncodingScheme(). JavaDoc of that function:
Returns the character encoding declared on the xml declaration Returns null if none was declared
If there is no xml declaration in the document, mEncodingScheme will be null. In XML 1.0 a xml declaration SHOULD be present, but is not required.
The JavaDoc of javax.xml.stream.events.StartDocument, the interface which is implemented defines the return value of the #getCharacterEncodingScheme()-function as follows:
the character encoding, defaults to "UTF-8"
org.codehaus.stax2.ri.evt.StartDocumentEventImpl#getCharacterEncodingScheme() returns the memberVariable mEncodingScheme, which is null when the XML has no xml declaration. I would expect the default value UTF-8.
A
org.codehaus.stax2.ri.evt.StartDocumentEventImplinstance is constructed from the values in aXMLStreamReaderinstance.The member variable
mEncodingSchemeis set from the reader-function#getCharacterEncodingScheme(). JavaDoc of that function:If there is no xml declaration in the document,
mEncodingSchemewill benull. In XML 1.0 a xml declaration SHOULD be present, but is not required.The JavaDoc of
javax.xml.stream.events.StartDocument, the interface which is implemented defines the return value of the#getCharacterEncodingScheme()-function as follows:org.codehaus.stax2.ri.evt.StartDocumentEventImpl#getCharacterEncodingScheme()returns the memberVariablemEncodingScheme, which isnullwhen the XML has no xml declaration. I would expect the default valueUTF-8.