From 787d5f5a01fd55c369a12dc7b04b72c46aba7a07 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Thu, 18 Apr 2024 13:49:38 +0700 Subject: [PATCH] fix(developer): prevent xmlns for ldml keyboard template child elements Fixes #11228. --- ...an.Developer.System.LdmlKeyboardProjectTemplate.pas | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/developer/src/kmconvert/Keyman.Developer.System.LdmlKeyboardProjectTemplate.pas b/developer/src/kmconvert/Keyman.Developer.System.LdmlKeyboardProjectTemplate.pas index 66036c5697f..d8cfa9cd8ff 100644 --- a/developer/src/kmconvert/Keyman.Developer.System.LdmlKeyboardProjectTemplate.pas +++ b/developer/src/kmconvert/Keyman.Developer.System.LdmlKeyboardProjectTemplate.pas @@ -73,11 +73,12 @@ function TLDMLKeyboardProjectTemplate.GetKeyboardFilename: string; end; const + XMLNS = 'https://schemas.unicode.org/cldr/45/keyboard3'; TemplateXML: string = ''#13#10+ // We won't inject the DOCTYPE because of pathing challenges, CLDR-15505 // ''#13#10+ - ''#13#10+ + ''#13#10+ ' '#13#10+ ' '#13#10+ ' '#13#10+ @@ -134,21 +135,22 @@ procedure TLDMLKeyboardProjectTemplate.WriteLDML; doc.DocumentElement := root; - node := doc.CreateElement('info', ''); + node := doc.CreateElement('info', XMLNS); node.Attributes['author'] := Author; node.Attributes['name'] := Name; root.ChildNodes.Insert(0, node); - node := doc.CreateElement('version', ''); + node := doc.CreateElement('version', XMLNS); node.Attributes['number'] := Version; root.ChildNodes.Insert(1, node); if tags <> '' then begin - node := doc.CreateElement('locales', ''); + node := doc.CreateElement('locales', XMLNS); while tags <> '' do begin tag := StrToken(tags, ' '); + // note: no XMLNS needed here node.AddChild('locale').Attributes['id'] := tag; end; root.ChildNodes.Insert(2, node);