     attrCheck: (node) =>
       @pattern.attrCheck(node)
 
-  { getPattern,
+  {
+    getPattern,
     AnyName, Attribute,
     Choice, Context,
     Data, Datatype, Define,

      when 'element' then new Element children[0], children[1]
      when 'define' then new Define h.getNodeAttr(node, "name"), children[0]
      when 'notAllowed' then new NotAllowed("not allowed by pattern", node)
      when 'empty' then new Empty()
      when 'text' then new Text()
      when 'data' then new Data h.getNodeAttr(node, "datatypeLibrary"), h.getNodeAttr(node, "type"), children
      when 'value' then new Value(h.getNodeAttr(node, "dataTypeLibrary"),

      if attrCheck instanceof NotAllowed
        return attrCheck
      if descend
        unless descend is true
          descend = descend - 1
        nextPattern = @pattern
        if node.childNodes?.length
          for child in node.childNodes
            switch h.getNodeType(child)
              when Node.TEXT_NODE
                if h.textContent(child).replace(/^\s+|\s+$/gm, "") is ""
                  continue
              when Node.COMMENT_NODE
                continue
            _nodelog node, "==> checking child", child, "against", nextPattern
            nextPattern = nextPattern.check(child, descend)
            _nodelog node, "child result of", child, "was", nextPattern
            if nextPattern instanceof NotAllowed
              return nextPattern
        # TODO: Detect missing elements
        if nextPattern.nullable()
          return new GoodElement(@name, @pattern)
        else
          return nextPattern
      else
        return new Empty("not descending into #{h.getLocalName(node)}", @pattern, node)
        if node.childNodes?.length
          return new GoodParentElement(@name, @pattern, node.childNodes)
        return new GoodElement(@name, @pattern)



