Skip to content

Instantly share code, notes, and snippets.

@mgray88
mgray88 / android-vector-drawable-to-svg.xsl
Created October 1, 2021 14:29 — forked from ok3141/android-vector-drawable-to-svg.xsl
Convert Android Vector Drawable to SVG with XSLT
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<svg xmlns="http://www.w3.org/2000/svg">
<xsl:attribute name="width">
<xsl:value-of select="substring-before(vector/@width, 'dp')"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="substring-before(vector/@height, 'dp')"/>
</xsl:attribute>