You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I guess that would make sense, given there is also method encodingSet() allows for determining whether encoding was indicated by XML declaration. Then again, parsers may (actually even need to) detect encoding from source if encoding declaration is missing.
I wish Stax specification was bit more prescriptive, as javadoc wording is still quite vague.
Anyway: I will think about this, and if changed as suggested should probably go in 4.2 as it is behavior change but minor one (could be argued it is a bug, to include in patch too but I prefer minor version).
A
org.codehaus.stax2.ri.evt.StartDocumentEventImpl
instance is constructed from the values in aXMLStreamReader
instance.The member variable
mEncodingScheme
is set from the reader-function#getCharacterEncodingScheme()
. JavaDoc of that function:If there is no xml declaration in the document,
mEncodingScheme
will 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 isnull
when the XML has no xml declaration. I would expect the default valueUTF-8
.The text was updated successfully, but these errors were encountered: