   class Attribute extends Pattern
     constructor: (@nameClass, pattern, @defaultValue = null) ->
       @pattern = getPattern pattern
-    startTagCloseDeriv: (node) =>
+    startTagCloseDeriv: (node) ->
       return new NotAllowed("attr StartTagCloseDeriv #{this}", this, node)
-    attDeriv: (attribute) =>
+    attDeriv: (attribute) ->
       contains = @nameClass.contains(attribute.name)
       if contains instanceof NotAllowed
         return contains

    pruneChoiceLeaf: (pattern) =>
      this

    startTagOpenDeriv: (node) =>
      return new NotAllowed("expected #{this}, found #{h.getLocalName(node)}", this, node)

    startTagCloseDeriv: (node) =>
      this

    endTagDeriv: (node) =>
      if this instanceof NotAllowed
        return this
      return new NotAllowed("invalid pattern: #{this}", this, node)

    attDeriv: (attribute) =>
      if h.getNamespacePrefix(attribute.name) is "xml"
        return this
      return new NotAllowed("unknown attribute #{attribute.name} (value #{attribute.value} - expecting #{this}", this, attribute)

    childDeriv: (node, descend = false) =>
      _nodelog(node, "starting childDeriv", node, this)
      if h.getNodeType(node) is Node.TEXT_NODE
        return @textDeriv(node)

     * Stub for Name class patterns
     * @see NameClass#contains
    ###
    contains: (nodeName) ->
      throw new RNGException("Cannot call 'contains(#{nodeName})' on pattern '#{@toString()}'")

    ###*
     * Stub for Ref class patterns
     * @see Ref#dereference
    ###
    dereference: ->
      return this

  #** Name Classes

  class NameClass extends Pattern
    contains: (node) ->
      throw new RNGException("Checking contains(#{node}) on undefined NameClass")

  class AnyName extends NameClass
    constructor: (exceptPattern) ->
      @except = getPattern exceptPattern
    contains: (node) ->
      unless @except instanceof NotAllowed
        return not @except.contains(node)
      true
    toString: ->
      if @except instanceof NotAllowed
        "*"
      else
