[PATCH v2 2/2] msxml3: Don't unlink the XML declaration when saving document.

Nikolay Sivov nsivov at codeweavers.com
Mon Apr 5 06:33:54 CDT 2021



On 4/5/21 2:27 PM, Dmitry Timoshkov wrote:
> Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
>> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
> Please don't commit this, while the patch is correct, it causes a regression:
> ::load()/::save() leads to a bug: the saved file has double <?xml> header,
> and needs another fix: doparse() should never add an xml declaration to a just
> loaded XML.
Thanks for catching that.
>
> Nikolay, do you recall why that code was added in the first place?

I was a long time ago. I think the reason is that libxml2 does not use a
separate node for prolog PI, and msxml does.
After the loading we have to expose prolog node as a normal child.

I don't think it always adds it, the meaning of 'doc->standalone != -1'
check is to add this node only if it was present in the input.

>
> I'll add more tests for such a case.
>




More information about the wine-devel mailing list