   else
     recurse = (node) ->
       if node.nodeType != node.ELEMENT_NODE or
-         node.tagName in ['defs', 'symbol', 'use']
+         node.nodeName in ['defs', 'use']
+        return null
+      # Ignore <symbol>s except the root <symbol> that we're bounding
+      if node.nodeName == 'symbol' and node != xml.documentElement
         return null
       switch node.tagName
         when 'rect', 'image'

      version = @nversions++
      @versions[string] =
        Symbol.parse "#{@key}$v#{version}", result, @dirname
      @versions[string].id = => "#{escapeId @key}$v#{version}"
    @versions[string]
  usesContext: true


    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.
