You're proposing one block of xml be mixed into another block of xml. That is merging. And an app that did that would have to recognize which parts to 'paste', and which are instructions to control pasting, and it shouldn't make assumptions based on the content (blueprintList, eventList, sectorDescription, need to be treated a certain way, etc).kartoFlane wrote:It wouldn't exactly merge the files, only paste the modded entries inside the blueprint - so that you have to take care of the nested structure yourself (that's why I opted to not use the word "merge").
GMM has no parser, which is how it tolerates all the errors. It just appends the text from one file onto another. 1.7 does it semi-intelligently by stripping xml declarations and UTF-8 BOM binary if present, and reencodes the combined text as BOM-less UTF-8 with normalized newlines and a new xml declaration. But it knows nothing of xml structure.kartoFlane wrote:I don't know about the parser GMM uses
Edit:: The Validate button does use Python's "xml.parsers.expat" but only to report how a standard xml parser fails. First, the validate function throws a bunch of regexes at a document: when typical problem patterns are matched, a message is printed and the document is preemptively corrected. Then the parser is the final sink-or-swim test: it gives up at the first typo it sees.
I wouldn't want to introduce those regexes into the patching process however. If their attempts to 'fix' get out of hand and break a diagnostic report, no harm is done.