parse a <code>&lt;process-engine .../&gt;</code> element and add it to the list of parsed elements
517359
protected void parseProcessEngine(Element element, List<ProcessEngineXml> parsedProcessEngines) {

    ProcessEngineXmlImpl processEngine = new ProcessEngineXmlImpl();

    // set name
    processEngine.setName(element.attribute(NAME));

    // set default
    String defaultValue = element.attribute(DEFAULT);
    if(defaultValue == null || defaultValue.isEmpty()) {
      processEngine.setDefault(false);
    } else {
      processEngine.setDefault(Boolean.parseBoolean(defaultValue));
    }

    Map<String, String> properties = new HashMap<String, String>();
    List<ProcessEnginePluginXml> plugins = new ArrayList<ProcessEnginePluginXml>();

    for (Element childElement : element.elements()) {
      if(CONFIGURATION.equals(childElement.getTagName())) {
        processEngine.setConfigurationClass(childElement.getText());

      } else if(DATASOURCE.equals(childElement.getTagName())) {
        processEngine.setDatasource(childElement.getText());

      } else if(JOB_ACQUISITION.equals(childElement.getTagName())) {
        processEngine.setJobAcquisitionName(childElement.getText());

      } else if(PROPERTIES.equals(childElement.getTagName())) {
        parseProperties(childElement, properties);

      } else if(PLUGINS.equals(childElement.getTagName())) {
        parseProcessEnginePlugins(childElement, plugins);

      }
    }

    // set collected properties
    processEngine.setProperties(properties);
    // set plugins
    processEngine.setPlugins(plugins);
    // add the process engine to the list of parsed engines.
    parsedProcessEngines.add(processEngine);

  }
1188402
protected void parseRootElement() {
    collectElementIds();
    parseDefinitionsAttributes();
    parseImports();
    parseMessages();
    parseSignals();
    parseErrors();
    parseEscalations();
    parseProcessDefinitions();
    parseCollaboration();

    // Diagram interchange parsing must be after parseProcessDefinitions,
    // since it depends and sets values on existing process definition objects
    parseDiagramInterchangeElements();

    for (BpmnParseListener parseListener : parseListeners) {
      parseListener.parseRootElement(rootElement, getProcessDefinitions());
    }
  }
1246673
private void processTag(boolean start) {
    	if (start) {
    		nested++;
    		doc.startElement(tag,attributes);
    	}
    	else {
            nested--;
            doc.endElement(tag);
    	}
    }
1253036
function replaceElementTagMentions (element, selector) {
  const processor = selectorParser((selectors) => {
    let nodesToReplace = []

    /**
     * looping breaks if we replace dynamically
     * so instead collect an array of nodes to swap and do it at the end
     */
    selectors.walk((node) => {
      if (node.value === element.tag && node.type === 'tag') { nodesToReplace.push(node) }
    })

    nodesToReplace.forEach((node) => node.replaceWith(element.pseudos.root))
  })

  return processor.process(selector).result
}
1153359
private LayoutElement parseElement(Element node, LayoutElement parent) {
        LayoutElement layoutElement = newLayoutElement(node, parent, null);
        parseChildren(node, layoutElement, Tag.ELEMENT, Tag.TRIGGER);
        return layoutElement;
    }
698812
public static void processRuleElement(ParserContext context, ConfigurationRuleBuilder rule, Element element)
    {
        String id = $(element).attr("id");

        List<Element> children = $(element).children().get();
        for (Element child : children)
        {
            Object result = context.processElement(child);

            switch ($(child).tag())
            {
            case "when":
                rule.when(((Condition) result));
                break;

            case "perform":
                rule.perform(((Operation) result));
                break;

            case "otherwise":
                rule.otherwise(((Operation) result));
                break;

            case "where":
                break;
            }
        }

        if (StringUtils.isNotBlank(id))
        {
            rule.withId(id);
        }

    }
681365
private void processElementDataset(GeneratorMain gen, Node cur) {
    // *** get parameters
    String seedstr = ((Element) cur).getAttribute(ATTR_SEED);
    if(clusterRandom != RandomFactory.DEFAULT && seedstr != null && seedstr.length() > 0) {
      clusterRandom = new RandomFactory((long) (ParseUtil.parseIntBase10(seedstr) * sizescale));
    }
    String testmod = ((Element) cur).getAttribute(ATTR_TEST);
    if(testmod != null && testmod.length() > 0) {
      testAgainstModel = Boolean.valueOf(ParseUtil.parseIntBase10(testmod) != 0);
    }
    // TODO: check for unknown attributes.
    XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
    while(iter.hasNext()) {
      Node child = iter.next();
      if(TAG_CLUSTER.equals(child.getNodeName())) {
        processElementCluster(gen, child);
      }
      else if(TAG_STATIC.equals(child.getNodeName())) {
        processElementStatic(gen, child);
      }
      else if(child.getNodeType() == Node.ELEMENT_NODE) {
        LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
      }
    }
  }
1237359
def parse_at_element(
            self,
            element,  # type: ET.Element
            state  # type: _ProcessorState
    ):
        # type: (...) -> Any
        """"""
        parsed_dict = self._dictionary.parse_at_element(element, state)
        return self._converter.from_dict(parsed_dict)
1296027
def parse_at_element(
            self,
            element,  # type: ET.Element
            state  # type: _ProcessorState
    ):
        # type: (...) -> Any
        """"""
        item_iter = element.findall(self._item_processor.element_path)
        return self._parse(item_iter, state)
719433
private ISyntaxElement processXMLEvent(XMLEvent event, Stack<IElementParser> parsersStack) throws ModelException
    {
        for (IElementParser parser : parsers)
        {
            if (parser.canParse(event))
            {
                IElementParser newParser = parser.createNewInstance();
                ISyntaxElement parsedElement = newParser.parse(event);
                if (!parsersStack.empty())
                {
                    parsersStack.peek().assignParsedElement(newParser.name(), parsedElement);
                }
                if (event.isStartElement())
                {
                    parsersStack.push(newParser);
                }
                return parsedElement;
            }
        }
        return null;
    }
929220
protected void parseProcessEnginePlugin(Element element, List<ProcessEnginePluginXml> plugins) {

    ProcessEnginePluginXmlImpl plugin = new ProcessEnginePluginXmlImpl();

    Map<String, String> properties = new HashMap<String, String>();

    for (Element childElement : element.elements()) {
      if(PLUGIN_CLASS.equals(childElement.getTagName())) {
        plugin.setPluginClass(childElement.getText());

      } else if(PROPERTIES.equals(childElement.getTagName())) {
        parseProperties(childElement, properties);

      }

    }

    plugin.setProperties(properties);
    plugins.add(plugin);
  }
1209631
protected void applyParseHandlers() {
    sequenceFlows = new HashMap<String, SequenceFlow>();
    for (Process process : bpmnModel.getProcesses()) {
      currentProcess = process;
      if (process.isExecutable()) {
        bpmnParserHandlers.parseElement(this, process);
      }
    }
  }
143930
@Override
  public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)
  {
    // since we return a constant, no need to read from the event
  }
51260
function parseAd(adElement) {
  var childNodes = adElement.childNodes;

  for (var adTypeElementKey in childNodes) {
    var adTypeElement = childNodes[adTypeElementKey];

    if (['Wrapper', 'InLine'].indexOf(adTypeElement.nodeName) === -1) {
      continue;
    }

    parserUtils.copyNodeAttribute('id', adElement, adTypeElement);
    parserUtils.copyNodeAttribute('sequence', adElement, adTypeElement);

    if (adTypeElement.nodeName === 'Wrapper') {
      return parseWrapper(adTypeElement);
    } else if (adTypeElement.nodeName === 'InLine') {
      return parseInLine(adTypeElement);
    }
  }
}
30276
function parseFile(file, done) {

    // create stream
    var saxStream = sax.createStream(options.strict, options);

    saxStream.on('error', function(e) {
      // unhandled errors will throw, since this is a proper node
      // event emitter.
      console.error('error!', e);
      // clear the error
      this._parser.error = null;
      this._parser.resume();

      // TODO: send to error callback
    });

    saxStream.on('opentag', function(node) {
      var name = node.name,
          value;

      if (parsedTags.indexOf(name) !== -1) {
        var parser = parsers[name];

        if (!parser) {
          throw new Error('[modelgen] no parser for tag <' + name + '>');
        }

        value = parser(node, this);
      }

      if (value) {
        stack.push(value);
      }
    });

    saxStream.on('closetag', function(nodeName) {
      if (parsedTags.indexOf(nodeName) !== -1) {
        stack.pop();
      }
    });

    saxStream.on('end', function() {

      var result = { byId: elementsById, byType: elementsByType };

      postProcess(result);
      done(null, result);
    });

    // pipe is supported, and it's readable/writable
    // same chunks coming in also go out.
    fs.createReadStream(file).pipe(saxStream);
  }
58397
@Override
  public void parseProcess(Element processElement, ProcessDefinitionEntity processDefinition) {
    addStartEventListener(processDefinition);
    addEndEventListener(processDefinition);
  }
314186
private List<DataElementInfo> processDataElements(TypeElement type, TemplateSelector templateSelector,
            org.jsoup.nodes.Element root) {
        List<DataElementInfo> dataElements = new ArrayList<>();

        // fields
        ElementFilter.fieldsIn(type.getEnclosedElements()).stream()
                .filter(field -> MoreElements.isAnnotationPresent(field, DataElement.class))
                .forEach(field -> {

                    // verify the field
                    if (field.getModifiers().contains(Modifier.PRIVATE)) {
                        abortWithError(field, "@%s member must not be private", DataElement.class.getSimpleName());
                    }
                    if (field.getModifiers().contains(Modifier.STATIC)) {
                        abortWithError(field, "@%s member must not be static", DataElement.class.getSimpleName());
                    }
                    Kind kind = getDataElementInfoKind(field.asType());
                    if (kind == Kind.Custom) {
                        warning(field, "Unknown type %s. Consider using one of %s.", field.asType(),
                                EnumSet.complementOf(EnumSet.of(Kind.Custom)));
                    }

                    // verify the selector
                    String selector = getSelector(field);
                    verifySelector(selector, field, templateSelector, root);

                    // verify the HTMLElement type
                    String typeName = MoreTypes.asTypeElement(field.asType()).getQualifiedName().toString();
                    if (kind == Kind.HTMLElement) {
                        verifyHTMLElement(typeName, selector, field, templateSelector, root);
                    }

                    // create info class for template processing
                    dataElements.add(new DataElementInfo(typeName, field.getSimpleName().toString(), selector,
                            kind, false));
                });

        // methods
        ElementFilter.methodsIn(type.getEnclosedElements()).stream()
                .filter(method -> MoreElements.isAnnotationPresent(method, DataElement.class))
                .forEach(method -> {

                    // verify method
                    if (method.getModifiers().contains(Modifier.PRIVATE)) {
                        abortWithError(method, "@%s method must not be private", DataElement.class.getSimpleName());
                    }
                    if (method.getModifiers().contains(Modifier.STATIC)) {
                        abortWithError(method, "@%s method must not be static", DataElement.class.getSimpleName());
                    }
                    Kind kind = getDataElementInfoKind(method.getReturnType());
                    if (kind == Kind.Custom) {
                        warning(method, "Unknown return type %s. Consider using one of %s.", method.getReceiverType(),
                                EnumSet.complementOf(EnumSet.of(Kind.Custom)));
                    }
                    if (!method.getParameters().isEmpty()) {
                        abortWithError(method, "@%s method must not have parameters",
                                DataElement.class.getSimpleName());
                    }

                    // verify the selector
                    String selector = getSelector(method);
                    verifySelector(selector, method, templateSelector, root);

                    // verify the HTMLElement type
                    String typeName = MoreTypes.asTypeElement(method.getReturnType())
                            .getQualifiedName().toString();
                    if (kind == Kind.HTMLElement) {
                        verifyHTMLElement(typeName, selector, method, templateSelector, root);
                    }
                    // create info class for template processing
                    dataElements.add(new DataElementInfo(typeName, method.getSimpleName().toString(), selector,
                            kind, true));
                });

        return dataElements;
    }