     if style
       match = ///(?:^|;)\s*#{styleKey}\s*:\s*([^;\s][^;]*)///i.exec style
       match?[1]
+
+getHref = (node) ->
+  for key in ['xlink:href', 'href']
+    if href = node.getAttribute key
+      return
+        key: key
+        href: href
+  key: null
+  href: null
 
 zIndex = (node) ->
   ## Check whether DOM node has a specified z-index, defaulting to zero.

          style += ';' if style
          node.setAttribute 'style', style + 'image-rendering:pixelated'
        ## Read file for width/height detection and/or inlining
        for key in ['xlink:href', 'href']
          if filename = node.getAttribute key
            break
        filename = path.join @dirname, filename if @dirname? and filename
        if filename? and not /^data:|file:|[a-z]+:\/\//.test filename # skip URLs
          filedata = null

        continue unless symbol?
        levels[symbol.zIndex] ?= []
        levels[symbol.zIndex].push use = doc.createElementNS SVGNS, 'use'
        use.setAttribute 'xlink:href', '#' + symbol.id
        use.setAttributeNS SVGNS, 'x', x
        use.setAttributeNS SVGNS, 'y', y
        scaleX = scaleY = 1
