Skip to content

Commit

Permalink
* Node.prototype.transform - refactored globalization to let node/@At…
Browse files Browse the repository at this point in the history
…tribute syntax
  • Loading branch information
uriel-online committed Aug 14, 2024
1 parent 618c571 commit fda318d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7646,7 +7646,7 @@ xover.modernize = async function (targetWindow) {
}
});
}
let templates = source.select(`//data/@name`).map(name => xover.xml.createNode(`<xsl:template mode="globalization:${param_name}" match="${name.value[0] == '@' ? name.value : `text()[.='${name.value}']|@*[.='${name.value}']|*[name()='${name.value}']`}"><xsl:text><![CDATA[${name.parentNode.selectFirst("value").textContent}]]></xsl:text></xsl:template>`));
let templates = source.select(`//data/@name`).map(name => xover.xml.createNode(`<xsl:template mode="globalization:${param_name}" match="${name.value.indexOf('@') != -1 ? name.value.replace(/"/g, "&quot;") : `text()[.='${name.value}']|@*[.='${name.value}']|*[name()='${name.value}']`}"><xsl:text><![CDATA[${name.parentNode.selectFirst("value").textContent}]]></xsl:text></xsl:template>`));
param.replaceWith(...templates)
}
} catch (e) {
Expand Down

0 comments on commit fda318d

Please sign in to comment.