parse a <code>&lt;process-archive .../&gt;</code> element and add it to the list of parsed elements
11092
protected void parseProcessArchive(Element element, List<ProcessArchiveXml> parsedProcessArchives) {

    ProcessArchiveXmlImpl processArchive = new ProcessArchiveXmlImpl();

    processArchive.setName(element.attribute(NAME));
    processArchive.setTenantId(element.attribute(TENANT_ID));

    List<String> processResourceNames = new ArrayList<String>();

    Map<String, String> properties = new HashMap<String, String>();
    for (Element childElement : element.elements()) {
      if(PROCESS_ENGINE.equals(childElement.getTagName())) {
        processArchive.setProcessEngineName(childElement.getText());

      } else if(PROCESS.equals(childElement.getTagName()) || RESOURCE.equals(childElement.getTagName())) {
        processResourceNames.add(childElement.getText());

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

      }
    }

    // set properties
    processArchive.setProperties(properties);

    // add collected resource names.
    processArchive.setProcessResourceNames(processResourceNames);

    // add process archive to list of parsed archives.
    parsedProcessArchives.add(processArchive);

  }
167511
private void readElementDeclaration() throws IOException, XmlPullParserException {
        read(START_ELEMENT);
        skip();
        readName();
        readContentSpec();
        skip();
        read('>');
    }
869887
public Set<Location> parse(Archive archive, String name) {
        try {
            return parse(archive, CLASS_FINDER, name);
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
900244
@Override
    public void processElement(Wrapper<Element> elementWrapper) {
        Element content = elementWrapper.getContent();
        content.detach();
        content.removeContent();
    }
190487
private void addFileElements(Collection<ArchiveEntry> files, Element filesElement) throws Exception
    {
        for (ArchiveEntry entry : files) {
            // Don't add files in META-INF to the package.xml file
            if (entry.getName().indexOf("META-INF") == -1) {
                XWikiDocument xdoc = getDocFromXML(entry.getFile());
                String reference = xdoc.getReference();
                Element element = new DOMElement(FILE_TAG);
                element.setText(reference);
                element.addAttribute("language", xdoc.getLocale());
                element.addAttribute("defaultAction", "0");

                // Add configured properties
                XAREntry cfgEntry = getEntryMap().get(reference);
                if (cfgEntry != null && cfgEntry.getType() != null) {
                    element.addAttribute("type", cfgEntry.getType());
                }

                filesElement.add(element);
            }
        }
    }
803414
def add_element(self, e):
        
        """
        if not isinstance(e, Iterable):
            raise TypeError("given element {} is not iterable in terms of "
                            "PyEMMAs coordinate pipeline.".format(e))

        # only if we have more than one element
        if not e.is_reader and len(self._chain) >= 1:
            data_producer = self._chain[-1]
            # avoid calling the setter of StreamingTransformer.data_producer, since this
            # triggers a re-parametrization even on readers (where it makes not sense)
            e._data_producer = data_producer
        e.chunksize = self.chunksize
        self._chain.append(e)
1209631
protected void applyParseHandlers() {
    sequenceFlows = new HashMap<String, SequenceFlow>();
    for (Process process : bpmnModel.getProcesses()) {
      currentProcess = process;
      if (process.isExecutable()) {
        bpmnParserHandlers.parseElement(this, process);
      }
    }
  }
140045
def process_element(self, element, key, **params):
        
        self.p = param.ParamOverrides(self, params)
        return self._apply(element, key)
1359355
public void parse(final String filename, final File dir) {
        filePath = stripFragment(filename);
        dirPath = dir;
        try {
            final File f = new File(dir, filePath);
            reader.setErrorHandler(new DITAOTXMLErrorHandler(f.getAbsolutePath(), logger));
            logger.info("Processing " + f.getAbsolutePath());
            reader.parse(f.toURI().toString());
        } catch (final RuntimeException e) {
            throw e;
        } catch (final Exception e) {
            throw new RuntimeException("Failed to parse " + filename + ": " + e.getMessage(), e);
        }
    }
434095
function parse(contents, retained, parser) {
    var errors = [], data = [], lines = 0;

    // optional parser
    if (!parser) parser = JSON;

    // process each line of the file
    contents.toString().split('\n').forEach(function(line) {
        if (!line) return;
        lines++;
        try {
            data.push(parser.parse(line));
        } catch (e) {
            e.line = line;
            errors.push(e);
        }
    });

    // if no errors/data, don't return an empty array
    var ret = {};
    if (errors.length) ret.errors = errors;
    if (data.length) ret.data = data;

    // if every line failed, probably not line-delimited
    if (errors.length == lines) ret.errors = retained;

    return ret;
}
670737
def parse_child_elements(self, element):
        ''''''
        for child in element.iterchildren():
            self.parsers[child.tag](child)
1174289
@Override
  protected ImmutableList<String> parseElements(String s) {
    ImmutableList.Builder<String> titles = ImmutableList.builder();
    Optional<XmlElement> child = XmlConverter.getChildOpt(s, "query", "allpages");
    if (child.isPresent()) {
      for (XmlElement pageElement : child.get().getChildren("p")) {
        String title = pageElement.getAttributeValue("title");
        log.debug("Found article title: \"{}\"", title);
        titles.add(title);
      }
    }
    return titles.build();
  }
1043719
public void process() {
		try {
			Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources("META-INF/persistence.xml");
			XMLInputFactory factory = XMLInputFactory.newInstance();
			List<String> persistenceUnits = new ArrayList<String>();
			
			while (urls.hasMoreElements()) {
				URL url = urls.nextElement();
				XMLStreamReader reader = factory.createXMLStreamReader(url.openStream());
				
				while (reader.hasNext()) {
					if (reader.next() == XMLStreamConstants.START_ELEMENT 
							&& reader.getName().getLocalPart().equals("persistence-unit")) {
						for (int i = 0; i < reader.getAttributeCount(); i++) {
							if (reader.getAttributeLocalName(i).equals("name")) {
								persistenceUnits.add(reader.getAttributeValue(i));
								break;
							}
						}
					}
				}
			}
			
			this.persistenceUnits = persistenceUnits;
		} catch (Exception e) {
			logger.error("Failed to parse persistence.xml", e);
		}
	}
792189
protected void processElement(List<PatternToken> patternTokens) {
    int counter = 0;
    for (PatternToken pToken : patternTokens) {
        if (pToken.getPhraseName() != null && counter > 0 && pToken.isReferenceElement()) {
            int tokRef = pToken.getMatch().getTokenRef();
            pToken.getMatch().setTokenRef(tokRef + counter - 1);
            String offsetToken = pToken.getString().replace("\\" + tokRef,
                    "\\" + (tokRef + counter - 1));
            pToken.setStringElement(offsetToken);
        }
      counter++;
    }
  }
638370
def _rt_parse_types(self, statement, element, mode, lineparser):
        """"""
        if mode == "insert":
            #Since we got to this point, there is *no* code element that owns the current
            #line which is being replaced; we are merely checking to see if the new line
            #being entered matches a type definition, do the same thing as "insert"
            tnew, start, end = self.tparser.parse_signature(statement, element, element)
            #We need to set sensible boundaries for 'start' and 'end' so that if the lines
            #immediately after this one are member definitions (for example) they get
            #associated correctly with this type.
            if tnew is not None:
                tnew.start, tnew.end = lineparser.absolute_charindex(statement, start, end)
                tnew.incomplete = True
                element.types[tnew.name.lower()] = tnew
                lineparser.additions.append((tnew, element))
1035006
public ProcessDefinitionEntity parseProcess(Element processElement) {
    // reset all mappings that are related to one process definition
    sequenceFlows = new HashMap<String, TransitionImpl>();

    ProcessDefinitionEntity processDefinition = new ProcessDefinitionEntity();

    /*
     * Mapping object model - bpmn xml: processDefinition.id -> generated by
     * processDefinition.key -> bpmn id (required) processDefinition.name ->
     * bpmn name (optional)
     */
    processDefinition.setKey(processElement.attribute("id"));
    processDefinition.setName(processElement.attribute("name"));
    processDefinition.setCategory(rootElement.attribute("targetNamespace"));
    processDefinition.setProperty(PROPERTYNAME_DOCUMENTATION, parseDocumentation(processElement));
    processDefinition.setTaskDefinitions(new HashMap<String, TaskDefinition>());
    processDefinition.setDeploymentId(deployment.getId());
    processDefinition.setProperty(PROPERTYNAME_JOB_PRIORITY, parsePriority(processElement, PROPERTYNAME_JOB_PRIORITY));
    processDefinition.setProperty(PROPERTYNAME_TASK_PRIORITY, parsePriority(processElement, PROPERTYNAME_TASK_PRIORITY));
    processDefinition.setVersionTag(processElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "versionTag"));

    try {
      String historyTimeToLive = processElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "historyTimeToLive",
          Context.getProcessEngineConfiguration().getHistoryTimeToLive());
      processDefinition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(historyTimeToLive));
    }
    catch (Exception e) {
      addError(new BpmnParseException(e.getMessage(), processElement, e));
    }

    boolean isStartableInTasklist = isStartable(processElement);
    processDefinition.setStartableInTasklist(isStartableInTasklist);

    LOG.parsingElement("process", processDefinition.getKey());

    parseScope(processElement, processDefinition);

    // Parse any laneSets defined for this process
    parseLaneSets(processElement, processDefinition);

    for (BpmnParseListener parseListener : parseListeners) {
      parseListener.parseProcess(processElement, processDefinition);
    }

    // now we have parsed anything we can validate some stuff
    validateActivities(processDefinition.getActivities());

    //unregister delegates
    for (ActivityImpl activity : processDefinition.getActivities()) {
      activity.setDelegateAsyncAfterUpdate(null);
      activity.setDelegateAsyncBeforeUpdate(null);
    }
    return processDefinition;
  }
454351
def fetch_and_parse(method, uri, params_prefix=None, **params):
    """"""
    doc = ElementTree.parse(fetch(method, uri, params_prefix, **params))
    return _parse(doc.getroot())