Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(developer): prevent xmlns for LDML keyboard template child elements #11251

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ function TLDMLKeyboardProjectTemplate.GetKeyboardFilename: string;
end;

const
XMLNS = 'https://schemas.unicode.org/cldr/45/keyboard3';
TemplateXML: string =
'<?xml version="1.0" encoding="UTF-8"?>'#13#10+
// We won't inject the DOCTYPE because of pathing challenges, CLDR-15505
// '<!DOCTYPE keyboard3 SYSTEM "ldmlKeyboard3.dtd">'#13#10+
'<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3">'#13#10+
'<keyboard3 xmlns="'+XMLNS+'">'#13#10+
' <keys>'#13#10+
' <import base="cldr" path="45/keys-Zyyy-punctuation.xml"/>'#13#10+
' <import base="cldr" path="45/keys-Zyyy-currency.xml"/> '#13#10+
Expand Down Expand Up @@ -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);
Expand Down
Loading