Read an element declaration. This contains a name and a content spec.
<!ELEMENT foo EMPTY >
<!ELEMENT foo (bar?,(baz|quux)) >
<!ELEMENT foo (#PCDATA|bar)* >
167511
private void readElementDeclaration() throws IOException, XmlPullParserException {
        read(START_ELEMENT);
        skip();
        readName();
        readContentSpec();
        skip();
        read('>');
    }
1029112
def element_data_from_name(name):
    '''
    '''

    name_lower = name.lower()
    if name_lower not in _element_name_map:
        raise KeyError('No element data for name \'{}\''.format(name))
    return _element_name_map[name_lower]
938955
@SuppressWarnings("unchecked")
    private <T> T parseElement(Element element, Class<T> cls) {
        T value;
        if (element == null) {
            value = null;
        } else if (MwsObject.class.isAssignableFrom(cls)) {
            value = MwsUtl.newInstance(cls);
            Element holdElement = currentElement;
            Node holdChild = currentChild;
            setCurrentElement(element);
            ((MwsObject) value).readFragmentFrom(this);
            currentElement = holdElement;
            currentChild = holdChild;
        } else if (cls == Object.class) {
            value = (T)element;
        } else {
            String v = getElementText(element);
            value = parseString(v, cls);
        }
        return value;
    }
776358
def element(self, inp=None):
        """"""
        if inp is not None:
            s = str(inp)[:self.length]
            s += ' ' * (self.length - len(s))
            return s
        else:
            return ' ' * self.length
792630
private void validateDefinesDeclaration(Node n, JSDocInfo info) {
    if (info != null && info.isDefine() && n.isLet()) {
      report(n, INVALID_DEFINE_ON_LET);
    }
  }
18656
function getDeclaration1() {
  const type = NodeType.DeclarationType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [];

  content.push(getProperty());
  if (checkS(pos)) content.push(getS());
  content.push(getPropertyDelim());
  if (checkS(pos)) content.push(getS());
  content.push(getValue());

  return newNode(type, content, line, column);
}
1047609
def consume_declaration(input = @tokens)
      declaration = {}
      value       = []

      declaration[:tokens] = input.collect do
        declaration[:name] = input.consume[:value]

        next_token = input.peek

        while next_token && next_token[:node] == :whitespace
          input.consume
          next_token = input.peek
        end

        unless next_token && next_token[:node] == :colon
          # Parse error.
          #
          # Note: The spec explicitly says to return nothing here, but Simon
          # Sapin's CSS parsing tests expect an error node.
          return create_node(:error, :value => 'invalid')
        end

        input.consume

        until input.peek.nil?
          value << consume_component_value(input)
        end
      end

      # Look for !important.
      important_tokens = value.reject {|token|
        node = token[:node]
        node == :whitespace || node == :comment || node == :semicolon
      }.last(2)

      if important_tokens.size == 2 &&
          important_tokens[0][:node] == :delim &&
          important_tokens[0][:value] == '!' &&
          important_tokens[1][:node] == :ident &&
          important_tokens[1][:value].downcase == 'important'

        declaration[:important] = true
        excl_index = value.index(important_tokens[0])

        # Technically the spec doesn't require us to trim trailing tokens after
        # the !important, but Simon Sapin's CSS parsing tests expect it and
        # tinycss2 does it, so we'll go along with the cool kids.
        value.slice!(excl_index, value.size - excl_index)
      else
        declaration[:important] = false
      end

      declaration[:value] = value
      create_node(:declaration, declaration)
    end
226185
private MessageElement readMessage(String documentation) {
    String name = readName();
    MessageElement.Builder builder = MessageElement.builder()
        .name(name)
        .qualifiedName(prefix + name)
        .documentation(documentation);

    String previousPrefix = prefix;
    prefix = prefix + name + ".";

    if (readChar() != '{') throw unexpected("expected '{'");
    while (true) {
      String nestedDocumentation = readDocumentation();
      if (peekChar() == '}') {
        pos++;
        break;
      }
      Object declared = readDeclaration(nestedDocumentation, Context.MESSAGE);
      if (declared instanceof FieldElement) {
        builder.addField((FieldElement) declared);
      } else if (declared instanceof OneOfElement) {
        builder.addOneOf((OneOfElement) declared);
      } else if (declared instanceof TypeElement) {
        builder.addType((TypeElement) declared);
      } else if (declared instanceof ExtensionsElement) {
        builder.addExtensions((ExtensionsElement) declared);
      } else if (declared instanceof OptionElement) {
        builder.addOption((OptionElement) declared);
      } else if (declared instanceof ExtendElement) {
        // Extend declarations always add in a global scope regardless of nesting.
        fileBuilder.addExtendDeclaration((ExtendElement) declared);
      }
    }
    prefix = previousPrefix;

    return builder.build();
  }
1214497
public AnnotationTypeElementDeclaration getElementDeclaration(String elemName)
    {
        if (_elementMap.containsKey(elemName))
            return _elementMap.get(elemName);
        return null;
    }
330002
static final String attr(Element element, String name, boolean ignoreNamespace) {
        NamedNodeMap attributes = element.getAttributes();

        for (int i = 0; i < attributes.getLength(); i++) {
            String localName = attributes.item(i).getNodeName();

            // [#103] If namespaces are ignored, consider only local
            // part of possibly namespace-unaware Element
            if (ignoreNamespace)
                localName = stripNamespace(localName);

            if (name.equals(localName))
                return attributes.item(i).getNodeValue();
        }

        return null;
    }
1248416
function getData(element, name) {
  if (isObject(element[name])) {
    return element[name];
  } else if (element.dataset) {
    return element.dataset[name];
  }

  return element.getAttribute('data-' + hyphenate(name));
}
864912
def empty_content?(element)
        text = +""
        child_nodes = element.child_nodes
        (0...child_nodes.length).each do |i|
          item = child_nodes.item(i)
          if item.node_type == Node.TEXT_NODE
            text << item.get_data.strip
          end
        end
        text.strip.length == 0
      end
1370061
def check(source)
    if source.match(/notice:\s+(.+?):\s+(.+)\s*/)
      source_element   = $1
      source_operation = ''
      source_message   = $2
                    
      source_elements  = source_element.split('/')
      source_operation = source_elements.pop.strip unless source_elements.last.match(/[\[\]]/)
                    
      if source_operation
        source_element = source_elements.join('/').strip
        
        logger.debug("#{source_element} includes: #{element} -- " + ( source_element.include?(element) ? 'true' : 'false' ))
        logger.debug("#{source_operation} is: #{operation} -- " + ( source_operation == operation ? 'true' : 'false' ))
        logger.debug("#{source_message} includes: #{message} -- " + ( source_message.include?(message) ? 'true' : 'false' ))
        
        if source_element.include?(element) && source_operation == operation && source_message.include?(message)
            logger.debug("MATCH! -> #{element} - #{operation} - #{message}") 
            return true
        end
      end
    end
    logger.debug("nothing -> #{element} - #{operation} - #{message}") 
    return false
  end
879272
def matches_content?(element)
      return true if @content.nil?

      case @content
      when String
        element.content == @content
      when Regexp
        element.content =~ @content
      end
    end
1066414
def isObservableElement(self, elementName):
        
        if not(isinstance(elementName, str)):
            raise TypeError(
                "Element name should be a string ." +
                "I receive this {0}"
                .format(elementName))

        return (True if (elementName == "*")
                else self._evaluateString(elementName))
1191780
static String getElementText(Element element) {
        StringBuffer buf = new StringBuffer();

        NodeList children = element.getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
            Node node = children.item(i);
            if (node.getNodeType() == Node.TEXT_NODE ||
                    node.getNodeType() == Node.CDATA_SECTION_NODE) {
                Text text = (Text) node;
                buf.append(text.getData().trim());
            }
        }

        return buf.toString();
    }
95310
def [](i)
      if @elements.size <= i && ! @eseq.empty?
        while true
          @eseq = @eseq.skip_whitespace
          if @eseq.first == 93 # ']'.ord
            @eseq = @eseq.skip_byte(93).skip_whitespace # ']'.ord
            break
          end
          new_value = read_value_and_consume
          @elements << new_value
          break if @elements.size > i
        end
      end
      @elements[i]
    end