Convert Wix WXL translation files into tables using SQL statements

The following article shows how to convert the XML in a Wix translation files with extension *.wxl into a table for use in SQL queries.

Wix can be translated into many languages using translation files. Per language or culture there is a single XML file with extension .wxl. All translation files are gathered in a single folder. The contents of each file resembles the following structure:

<?xml version="1.0" encoding="utf-8"?>

<WixLocalization Culture="en-US" Codepage="1252" xmlns="http://wixtoolset.org/schemas/v4/wxl">
    <String Id="WixUIBack" Overridable="yes">&amp;Back</String>
    <String Id="WixUINext" Overridable="yes">&amp;Next</String>

The following query can be used to process the data into a table:

create or replace table WixTranslationKeys@InMemoryStorage
as
select xte.*
from   files@os('C:\Users\gle3.WS212\Documents\ws-other\UI.wixext\src\wixlib', 'wixui*.wxl', false) fle
join   read_file_text@os(fle.file_path) rft
join   xmltable
       ( '//*["String"=local-name()]'
         passing rft.file_contents
         columns cultureCode varchar2 path '../@Culture'
         ,       id          varchar2 path '@Id'
         ,       txt         varchar2 path 'text()'
       ) xte

The use of `[“String”=local-name()]" circumvents specification of namespaces.

A sample of the results are displayed below: