Fix detection of invalid spaces in prolog by gnodet · Pull Request #20 · codehaus-plexus/plexus-xml

@gnodet

@gnodet

cstamas

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this will now make XML with newline as first line always (and consistently) fail on all plaf

@gnodet

So this will now make XML with newline as first line always (and consistently) fail on all plaf

Yes. When the xmldecl <?xml ...?> is present, it has to be at the very beginning of the file and no whitespace is allowed before. The problem is that a single whitespace could be silently discarded and it was thus failing on windows when using \r\n as the line separator because of the length of 2.