Use:
substring-before(substring-after(@style, "'"),
"'"
)
XSLT-based verification:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/*">
"<xsl:value-of select=
"substring-before(substring-after(@style, "'"),
"'"
)
"/>"
</xsl:template>
</xsl:stylesheet>
when this transformation is applied on the provided XML document:
<a href="http://www.test.com" style=
"background-image: url('http://www.test.com/hello.jpg');">test</a>
the wanted, correct result is produced:
"http://www.test.com/hello.jpg"