Currently in my index.html
file I have the following script line:
<script src="https://maps.googleapis.com/maps/api/js?key=MY_KEY&libraries=places"></script>
Is it possible to extract the src
variable and import it in the script as a variable? I tried using xsl:variable
located in an external variable.xsl
file such as this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="google" select="API_KEY"></xsl:variable>
</xsl:stylesheet>
And then trying to import it into my script,
<xsl:include href="variable.xsl"/>
<script src="{$google}"></script>
But even when the xls:variable
is in the same file, the script source doesn't work.
I would like to push my code to a public repo, which is why I'd like to hide the key.