Skip to content

Commit

Permalink
CLDR-16846 fix bulk import (#3127)
Browse files Browse the repository at this point in the history
- use negative lookbehind in split to preserve slashes in attributes

Example:

//ldml/dates/timeZoneNames/zone[@type="America/Guyana"]/exemplarCity
  • Loading branch information
srl295 authored Aug 2, 2023
1 parent 017d470 commit 6ab2a71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/cldr-apps/js/src/esm/cldrBulkConverter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function xlsGenerateXml(locale, wb, xColumn, vColumn) {

// now the fun part
// //ldml/localeDisplayNames/territories/territory[@type="IO"][@alt="chagos"]
let xpathParts = xpath.split("/").slice(2);
let xpathParts = xpath.split(/(?<!\[@[^=]+="[^"]+)\//).slice(2);
const root = doc.getRootNode(); // our node
let n = root; // start with root
const NAME = /^[^\[]*/;
Expand Down

0 comments on commit 6ab2a71

Please sign in to comment.