1 <?xml version="1.0" encoding="utf-8"?>
3 <!-- attempt to replace relative URLs with absolute URLs -->
4 <!-- http://stackoverflow.com/questions/3824631/replace-href-value-in-anchor-tags-of-html-using-xslt -->
6 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
7 <xsl:output method="xml"/>
9 <xsl:template match="node()|@*">
11 <xsl:apply-templates select="node()|@*"/>
15 <xsl:template match="*/@src[starts-with(.,'.')]">
16 <xsl:attribute name="src">
17 <xsl:value-of select="concat('{{$dirurl}}',.)"/>
20 <xsl:template match="*/@src[starts-with(.,'/')]">
21 <xsl:attribute name="src">
22 <xsl:value-of select="concat('{{$rooturl}}',.)"/>