Automatically prepend the XML preprocessor directive if not present so we generate well-formed XML documents
This commit is contained in:
parent
df3309c087
commit
1f0e8845e8
@ -940,6 +940,11 @@ namespace UniversalEditor.DataFormats.Markup.XML
|
||||
WriteStartTag(mvarCompensateTopLevelTagName);
|
||||
}
|
||||
|
||||
if (!(mom.Elements.Count > 0 && mom.Elements [0] is MarkupPreprocessorElement && (mom.Elements [0] as MarkupPreprocessorElement).FullName == "xml"))
|
||||
{
|
||||
tw.WriteLine ("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
|
||||
}
|
||||
|
||||
foreach (MarkupElement element in mom.Elements)
|
||||
{
|
||||
WriteElement(element, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user