In XSL I am accessing an XML file which contains a config variable which is used in the stylesheet using the document function.
<xsl:variable name="files" select="document(concat('../../../', utils:Replace(./@src, '/groceries/MarketingContent/', 'MarketingContent/'), '.xml'))/Files" />
<xsl:call-template name="script">
<xsl:with-param name="src" select="concat('/groceries/',$files/@outputPath,'/', utils:Replace($files/File/@name, '.js', concat('.', $files/@hashKey, '.js')))"/>
</xsl:call-template>
The problem is if this xml document does not exists I get an error, rendering the website unuable.
I am using version 1.0, is there a way to check that a file exists so as to deal with this issue gracefully??
Thanks in advance
There’s no way of doing this in XSLT 1.0 without processor-specific extensions.