Detect bad xml before starting import to avoid errors on long running
transaction or half-state pages after rollback on error
This is not about validation of the xaml against export.xsd
- Just read the given source by XMLReader to check if everything is fine
with the syntax of the xml, like unclosed tags etc.
- The xml check is part of doImport, because that is already wrappred
in a try/catch and has exception handling in caller code
- No i18n for the technial exception as handled by other code as well,
also the message by libxml would be en always
- Added a seek function to ImportSource, the interface is not tagged as
@stable, so no release notes or backward compatibility
- Moved the XMLReader::open into own function to reuse it, because the
reader has to be reopen after the validation, store the reference to
the source in new class property for the reopen
- Use AtEase to suppress warnings from read of invalid xml (php #64230)
Bug: T277766
Change-Id: Iea70e6c42526cb1efc787b335abe19f59abf4786