Skip to content

Commit

Permalink
chore(common): handle an empty <transformGroup/> properly
Browse files Browse the repository at this point in the history
- difference in fast-xml-parser and xml2js handling here
- part of the move to fast-xml-parser

Fixes: #12208
  • Loading branch information
srl295 committed Sep 10, 2024
1 parent 171e37c commit c24ba0f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ export class LDMLKeyboardXMLSourceFileReader {
if(source?.keyboard3?.transforms) {
for(const transforms of source.keyboard3.transforms) {
boxXmlArray(transforms, 'transformGroup');
// need to see if there's an empty ('') element.
// the schema allows an empty object, but the spec doesn't.
for (let i=0; i<transforms.transformGroup.length; i++) {
if (transforms.transformGroup[i] === '') {
// substitute empty object. the compiler will complain about it.
transforms.transformGroup[i] = { };
}
}
for (const transformGroup of transforms.transformGroup) {
boxXmlArray(transformGroup, 'transform');
boxXmlArray(transformGroup, 'reorder');
Expand Down

0 comments on commit c24ba0f

Please sign in to comment.