From 80784fb47ad7292be97efa189623d066cc534d40 Mon Sep 17 00:00:00 2001 From: Pier-Paolo Mammi Date: Thu, 14 May 2026 09:42:43 +0200 Subject: [PATCH] add automatic saving of properties containing XML data --- scripts/extract-elx/extract-elx.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/extract-elx/extract-elx.js b/scripts/extract-elx/extract-elx.js index 577f975..d5c5218 100644 --- a/scripts/extract-elx/extract-elx.js +++ b/scripts/extract-elx/extract-elx.js @@ -486,6 +486,14 @@ async function processArrayProperty(outputPath, propertyName, arr) { } else if (typeof item === 'object' && item !== null) { fileInfo = await saveJsonProperty(dirPath, itemName, item); indexData.itemTypes.push({ index: originalIndex, type: 'json', fileName: `${itemName}.json` }); + // Additional processing for some items (e.g. extract XML from strings inside objects) + for (const [key, value] of Object.entries(item)) { + if (typeof value === 'string' && isXmlContent(value)) { + const xmlFileName = `${itemName}_${key}`; + const xmlFileInfo = await saveStringProperty(dirPath, xmlFileName, value); + result.files.push(xmlFileInfo.filepath); + } + } } else { fileInfo = await saveJsonProperty(dirPath, itemName, item); indexData.itemTypes.push({ index: originalIndex, type: typeof item, fileName: `${itemName}.json` });