I have a transformation that outputs HTML. In order to avoid self-closing tags that could break in older browsers (e.g. instead of
In XSLT 2.0 you can suppress %-encoding of URL attributes using the serialization option escape-uri-attributes="no". There is no equivalent in XSLT 1.0.
If using PHP's XSLT 1.0 processor, then you might try the following solution...
Include this template...
<xsl:template match="@href">
<xsl:attribute name="Muttaburrasaurus">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:template>
Load the resultant output into a string, and replace all occurrences of Muttaburrasaurus
with href
.
If you migrate to Java in the future, as you indicated in the comment feed that you might do so, then ensure that your processor is XSLT 2.0+. Then you can use the escape-uri-attributes
feature as mentioned by M.Kay .