Re: XmlStreamReader encoding regexp does not work anymore without version

Gary Gregory <[email protected]>
Newsgroups gmane.comp.jakarta.commons.user
Message-ID <CACZkXPytqPEeowfe=-rMFddJCCv8O0tCVfA=87EQvhv6fv3wgQ@mail.gmail.com>
Hi Andreas,

In an "xml" PI, the "version" is NOT optional, see
https://www.w3.org/TR/REC-xml/#sec-pi

If we tried to handle all cases of invalid documents, then there would
be no end to it.

Gary

On Tue, Jan 2, 2024 at 9:36 AM Gary Gregory <[email protected]> wrote:
>
> Ah, you are talking about something different, I am sorry about that. Looking...
>
> Gary
>
> On Tue, Jan 2, 2024 at 9:35 AM Gary Gregory <[email protected]> wrote:
> >
> > Hello Andrea,
> >
> > Please try git master or a 2.16.0-SNAPSHOT build
> > (https://repository.apache.org/content/repositories/snapshots/commons-io/commons-io/2.16.0-SNAPSHOT)
> > I fixed this today as reported in https://github.com/apache/commons-io/pull/550
> >
> > TY!
> > Gary
> >
> > On Tue, Jan 2, 2024 at 9:33 AM Andreas Hubold
> > <[email protected]> wrote:
> > >
> > > Hi,
> > >
> > > the regular expression for the encoding was changed in XmlStreamReader
> > > between 2.13.0 and 2.15.1.
> > >
> > > It now requires a version attribute in the XML declaration and does not
> > > work anymore with some real world files.
> > >
> > > For example, the encoding from the following example declaration is
> > > respected by 2.13.0, but not by 2.15.1
> > >
> > > <?xml encoding='Cp1047'?>
> > >
> > > It works if the version is specified: <?xml version="1.0"
> > > encoding='Cp1047'?>
> > >
> > > However note, that https://www.w3.org/TR/xml/#NT-EncodingDecl also
> > > mentions examples without version attribute, at least for entities. It
> > > would be good to restore the previous behavior, IMHO.
> > >
> > > Cheers,
> > > Andreas
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [email protected]
> > > For additional commands, e-mail: [email protected]
> > >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.