I’m using some XSL to transform into html including ‘empty’ <script> tags which are written with an src element but no content e.g. <script src="somescript.js"></script>
Widgets from Google Amazon or others are often out of your control but the trouble is depending on your XSLT settings the XSL transformer might remove the </script> and transform it to <script src="" /> or even worse I’ve seen examples of it try to put the closing tag in for a self closing tag but in the wrong place.
I found this question on stackoverflow.com with an answer which
hacked fixed it for me. Reposting here in case the original gets (re)moved. Thanks Jasso!
<!-- Identity template for empty elements -->
<!-- Define a dummy variable with empty content -->
<xsl:variable name="empty" select="''"/>
<xsl:apply-templates select="@* | node()" />
Post a Comment