Adds IntermediateCatchEvent attributes to exported XML element

        :param node_params: dictionary with given intermediate catch event parameters,
        :param output_element: object representing BPMN XML 'intermediateCatchEvent' element.
171308
def export_boundary_event_info(node_params, output_element):
        
        output_element.set(consts.Consts.parallel_multiple, node_params[consts.Consts.parallel_multiple])
        output_element.set(consts.Consts.cancel_activity, node_params[consts.Consts.cancel_activity])
        output_element.set(consts.Consts.attached_to_ref, node_params[consts.Consts.attached_to_ref])
        definitions = node_params[consts.Consts.event_definitions]
        for definition in definitions:
            definition_id = definition[consts.Consts.id]
            definition_type = definition[consts.Consts.definition_type]
            output_definition = eTree.SubElement(output_element, definition_type)
            if definition_id != "":
                output_definition.set(consts.Consts.id, definition_id)
406746
public static String createXMLFeatureDescriptor(
      final TrainingParameters params) throws IOException {

    final Element aggGenerators = new Element("generators");
    final Document doc = new Document(aggGenerators);

    // <generators>
    // <cache>
    // <generators>
    final Element cached = new Element("cache");
    final Element generators = new Element("generators");
    // <window prevLength="2" nextLength="2">
    // <token />
    // </window>
    if (Flags.isTokenFeature(params)) {
      setWindow(params);
      final String tokenFeatureRange = Flags.getTokenFeaturesRange(params);
      final Element tokenFeature = new Element("custom");
      tokenFeature.setAttribute("class", TokenFeatureGenerator.class.getName());
      tokenFeature.setAttribute("range", tokenFeatureRange);
      final Element tokenWindow = new Element("window");
      tokenWindow.setAttribute("prevLength", Integer.toString(leftWindow));
      tokenWindow.setAttribute("nextLength", Integer.toString(rightWindow));
      tokenWindow.addContent(tokenFeature);
      generators.addContent(tokenWindow);
      System.err.println("-> Token features added!: Window range " + leftWindow
          + ":" + rightWindow);
    }
    if (Flags.isTokenClassFeature(params)) {
      setWindow(params);
      final String tokenClassFeatureRange = Flags
          .getTokenClassFeaturesRange(params);
      final Element tokenClassFeature = new Element("custom");
      tokenClassFeature.setAttribute("class",
          TokenClassFeatureGenerator.class.getName());
      tokenClassFeature.setAttribute("range", tokenClassFeatureRange);
      final Element tokenClassWindow = new Element("window");
      tokenClassWindow.setAttribute("prevLength", Integer.toString(leftWindow));
      tokenClassWindow.setAttribute("nextLength",
          Integer.toString(rightWindow));
      tokenClassWindow.addContent(tokenClassFeature);
      generators.addContent(tokenClassWindow);
      System.err.println("-> Token Class Features added!: Window range "
          + leftWindow + ":" + rightWindow);
    }
    if (Flags.isWordShapeSuperSenseFeature(params)) {
      setWindow(params);
      final Element wordShapeSuperSenseFeature = new Element("custom");
      wordShapeSuperSenseFeature.setAttribute("class",
          WordShapeSuperSenseFeatureGenerator.class.getName());
      final Element wordShapeWindow = new Element("window");
      wordShapeWindow.setAttribute("prevLength", Integer.toString(leftWindow));
      wordShapeWindow.setAttribute("nextLength", Integer.toString(rightWindow));
      wordShapeWindow.addContent(wordShapeSuperSenseFeature);
      generators.addContent(wordShapeWindow);
      System.err
          .println("-> Word Shape SuperSense Features added!: Window range "
              + leftWindow + ":" + rightWindow);
    }
    if (Flags.isOutcomePriorFeature(params)) {
      final Element outcomePriorFeature = new Element("custom");
      outcomePriorFeature.setAttribute("class",
          OutcomePriorFeatureGenerator.class.getName());
      generators.addContent(outcomePriorFeature);
      System.err.println("-> Outcome Prior Features added!");
    }
    if (Flags.isPreviousMapFeature(params)) {
      final Element previousMapFeature = new Element("custom");
      previousMapFeature.setAttribute("class",
          PreviousMapFeatureGenerator.class.getName());
      generators.addContent(previousMapFeature);
      System.err.println("-> Previous Map Features added!");
    }
    if (Flags.isSentenceFeature(params)) {
      final String beginSentence = Flags.getSentenceFeaturesBegin(params);
      final String endSentence = Flags.getSentenceFeaturesEnd(params);
      final Element sentenceFeature = new Element("custom");
      sentenceFeature.setAttribute("class",
          SentenceFeatureGenerator.class.getName());
      sentenceFeature.setAttribute("begin", beginSentence);
      sentenceFeature.setAttribute("end", endSentence);
      generators.addContent(sentenceFeature);
      System.err.println("-> Sentence Features added!");
    }
    if (Flags.isPrefixFeature(params)) {
      final String beginPrefix = Flags.getPrefixFeaturesBegin(params);
      final String endPrefix = Flags.getPrefixFeaturesEnd(params);
      final Element prefixFeature = new Element("custom");
      prefixFeature.setAttribute("class",
          PrefixFeatureGenerator.class.getName());
      prefixFeature.setAttribute("begin", beginPrefix);
      prefixFeature.setAttribute("end", endPrefix);
      generators.addContent(prefixFeature);
      System.err.println("-> Prefix Features added!");
    }
    if (Flags.isSuffixFeature(params)) {
      final String beginSuffix = Flags.getSuffixFeaturesBegin(params);
      final String endSuffix = Flags.getSuffixFeaturesEnd(params);
      final Element suffixFeature = new Element("custom");
      suffixFeature.setAttribute("class",
          SuffixFeatureGenerator.class.getName());
      suffixFeature.setAttribute("begin", beginSuffix);
      suffixFeature.setAttribute("end", endSuffix);
      generators.addContent(suffixFeature);
      System.err.println("-> Suffix Features added!");
    }
    if (Flags.isBigramClassFeature(params)) {
      final Element bigramFeature = new Element("custom");
      bigramFeature.setAttribute("class",
          BigramClassFeatureGenerator.class.getName());
      generators.addContent(bigramFeature);
      System.err.println("-> Bigram Class Features added!");
    }
    if (Flags.isTrigramClassFeature(params)) {
      final Element trigramFeature = new Element("custom");
      trigramFeature.setAttribute("class",
          TrigramClassFeatureGenerator.class.getName());
      generators.addContent(trigramFeature);
      System.err.println("-> Trigram Class Features added!");
    }
    if (Flags.isFourgramClassFeature(params)) {
      final Element fourgramFeature = new Element("custom");
      fourgramFeature.setAttribute("class",
          FourgramClassFeatureGenerator.class.getName());
      generators.addContent(fourgramFeature);
      System.err.println("-> Fourgram Class Features added!");
    }
    if (Flags.isFivegramClassFeature(params)) {
      final Element fivegramFeature = new Element("custom");
      fivegramFeature.setAttribute("class",
          FivegramClassFeatureGenerator.class.getName());
      generators.addContent(fivegramFeature);
      System.err.println("-> Fivegram Class Features added!");
    }
    if (Flags.isCharNgramClassFeature(params)) {
      final String charngramRange = Flags.getCharNgramFeaturesRange(params);
      final String[] rangeArray = Flags.processNgramRange(charngramRange);
      final Element charngramFeature = new Element("custom");
      charngramFeature.setAttribute("class",
          CharacterNgramFeatureGenerator.class.getName());
      charngramFeature.setAttribute("minLength", rangeArray[0]);
      charngramFeature.setAttribute("maxLength", rangeArray[1]);
      generators.addContent(charngramFeature);
      System.err.println("-> CharNgram Class Features added!");
    }
    // Dictionary Features
    if (Flags.isDictionaryFeatures(params)) {
      setWindow(params);
      final String dictPath = Flags.getDictionaryFeatures(params);
      final String seqCodec = Flags.getSequenceCodec(params);
      final List<File> fileList = StringUtils.getFilesInDir(new File(dictPath));
      for (final File dictFile : fileList) {
        final Element dictFeatures = new Element("custom");
        dictFeatures.setAttribute("class",
            DictionaryFeatureGenerator.class.getName());
        dictFeatures.setAttribute("dict",
            IOUtils.normalizeLexiconName(dictFile.getName()));
        dictFeatures.setAttribute("seqCodec", seqCodec);
        final Element dictWindow = new Element("window");
        dictWindow.setAttribute("prevLength", Integer.toString(leftWindow));
        dictWindow.setAttribute("nextLength", Integer.toString(rightWindow));
        dictWindow.addContent(dictFeatures);
        generators.addContent(dictWindow);
      }
      System.err.println("-> Dictionary Features added!");
    }
    // Brown clustering features
    if (Flags.isBrownFeatures(params)) {
      setWindow(params);
      // previous 2 maps features
      final Element prev2MapFeature = new Element("custom");
      prev2MapFeature.setAttribute("class",
          Prev2MapFeatureGenerator.class.getName());
      generators.addContent(prev2MapFeature);
      // previous map and token feature (in window)
      final Element prevMapTokenFeature = new Element("custom");
      prevMapTokenFeature.setAttribute("class",
          PreviousMapTokenFeatureGenerator.class.getName());
      final Element prevMapTokenWindow = new Element("window");
      prevMapTokenWindow.setAttribute("prevLength",
          Integer.toString(leftWindow));
      prevMapTokenWindow.setAttribute("nextLength",
          Integer.toString(rightWindow));
      prevMapTokenWindow.addContent(prevMapTokenFeature);
      generators.addContent(prevMapTokenWindow);
      // brown clustering features
      final String brownClusterPath = Flags.getBrownFeatures(params);
      final List<File> brownClusterFiles = Flags
          .getClusterLexiconFiles(brownClusterPath);
      for (final File brownClusterFile : brownClusterFiles) {
        // brown bigram class features
        final Element brownBigramFeatures = new Element("custom");
        brownBigramFeatures.setAttribute("class",
            BrownBigramFeatureGenerator.class.getName());
        brownBigramFeatures.setAttribute("dict",
            IOUtils.normalizeLexiconName(brownClusterFile.getName()));
        generators.addContent(brownBigramFeatures);
        // brown token feature
        final Element brownTokenFeature = new Element("custom");
        brownTokenFeature.setAttribute("class",
            BrownTokenFeatureGenerator.class.getName());
        brownTokenFeature.setAttribute("dict",
            IOUtils.normalizeLexiconName(brownClusterFile.getName()));
        final Element brownTokenWindow = new Element("window");
        brownTokenWindow.setAttribute("prevLength",
            Integer.toString(leftWindow));
        brownTokenWindow.setAttribute("nextLength",
            Integer.toString(rightWindow));
        brownTokenWindow.addContent(brownTokenFeature);
        generators.addContent(brownTokenWindow);
        // brown token class feature
        final Element brownTokenClassFeature = new Element("custom");
        brownTokenClassFeature.setAttribute("class",
            BrownTokenClassFeatureGenerator.class.getName());
        brownTokenClassFeature.setAttribute("dict",
            IOUtils.normalizeLexiconName(brownClusterFile.getName()));
        final Element brownTokenClassWindow = new Element("window");
        brownTokenClassWindow.setAttribute("prevLength",
            Integer.toString(leftWindow));
        brownTokenClassWindow.setAttribute("nextLength",
            Integer.toString(rightWindow));
        brownTokenClassWindow.addContent(brownTokenClassFeature);
        generators.addContent(brownTokenClassWindow);
      }
      System.err.println("-> Brown Cluster Features added!");
    }
    // Clark clustering features
    if (Flags.isClarkFeatures(params)) {
      setWindow(params);
      final String clarkClusterPath = Flags.getClarkFeatures(params);
      final List<File> clarkClusterFiles = Flags
          .getClusterLexiconFiles(clarkClusterPath);
      for (final File clarkCluster : clarkClusterFiles) {
        final Element clarkFeatures = new Element("custom");
        clarkFeatures.setAttribute("class",
            ClarkFeatureGenerator.class.getName());
        clarkFeatures.setAttribute("dict",
            IOUtils.normalizeLexiconName(clarkCluster.getName()));
        final Element clarkWindow = new Element("window");
        clarkWindow.setAttribute("prevLength", Integer.toString(leftWindow));
        clarkWindow.setAttribute("nextLength", Integer.toString(rightWindow));
        clarkWindow.addContent(clarkFeatures);
        generators.addContent(clarkWindow);
      }
      System.err.println("-> Clark Cluster Features added!");
    }
    // word2vec clustering features
    if (Flags.isWord2VecClusterFeatures(params)) {
      setWindow(params);
      final String word2vecClusterPath = Flags
          .getWord2VecClusterFeatures(params);
      final List<File> word2vecClusterFiles = Flags
          .getClusterLexiconFiles(word2vecClusterPath);
      for (final File word2vecFile : word2vecClusterFiles) {
        final Element word2vecClusterFeatures = new Element("custom");
        word2vecClusterFeatures.setAttribute("class",
            Word2VecClusterFeatureGenerator.class.getName());
        word2vecClusterFeatures.setAttribute("dict",
            IOUtils.normalizeLexiconName(word2vecFile.getName()));
        final Element word2vecClusterWindow = new Element("window");
        word2vecClusterWindow.setAttribute("prevLength",
            Integer.toString(leftWindow));
        word2vecClusterWindow.setAttribute("nextLength",
            Integer.toString(rightWindow));
        word2vecClusterWindow.addContent(word2vecClusterFeatures);
        generators.addContent(word2vecClusterWindow);
      }
      System.err.println("-> Word2Vec Clusters Features added!");
    }
    // Morphological features
    if (Flags.isPOSTagModelFeatures(params)) {
      setWindow(params);
      final String posModelPath = Flags.getPOSTagModelFeatures(params);
      final String posModelRange = Flags.getPOSTagModelFeaturesRange(params);
      final Element posTagClassFeatureElement = new Element("custom");
      posTagClassFeatureElement.setAttribute("class",
          POSTagModelFeatureGenerator.class.getName());
      posTagClassFeatureElement.setAttribute("model",
          IOUtils.normalizeLexiconName(new File(posModelPath).getName()));
      posTagClassFeatureElement.setAttribute("range", posModelRange);
      final Element posTagClassFeatureWindow = new Element("window");
      posTagClassFeatureWindow.setAttribute("prevLength",
          Integer.toString(leftWindow));
      posTagClassFeatureWindow.setAttribute("nextLength",
          Integer.toString(rightWindow));
      posTagClassFeatureWindow.addContent(posTagClassFeatureElement);
      generators.addContent(posTagClassFeatureWindow);
      System.err.println("-> POSTagModel Features added!");
    }
    if (Flags.isPOSDictionaryFeatures(params)) {
      setWindow(params);
      final String posDictPath = Flags.getPOSDictionaryFeatures(params);
      final Element posDictFeatures = new Element("custom");
      posDictFeatures.setAttribute("class",
          POSDictionaryFeatureGenerator.class.getName());
      posDictFeatures.setAttribute("dict",
          IOUtils.normalizeLexiconName(new File(posDictPath).getName()));
      final Element posDictWindow = new Element("window");
      posDictWindow.setAttribute("prevLength", Integer.toString(leftWindow));
      posDictWindow.setAttribute("nextLength", Integer.toString(rightWindow));
      posDictWindow.addContent(posDictFeatures);
      generators.addContent(posDictWindow);
      System.err.println("-> POSDictionary Features added!");
    }
    if (Flags.isLemmaModelFeatures(params)) {
      setWindow(params);
      final String lemmaModelPath = Flags.getLemmaModelFeatures(params);
      final Element lemmaClassFeatureElement = new Element("custom");
      lemmaClassFeatureElement.setAttribute("class",
          LemmaModelFeatureGenerator.class.getName());
      lemmaClassFeatureElement.setAttribute("model",
          IOUtils.normalizeLexiconName(new File(lemmaModelPath).getName()));
      final Element lemmaClassFeatureWindow = new Element("window");
      lemmaClassFeatureWindow.setAttribute("prevLength",
          Integer.toString(leftWindow));
      lemmaClassFeatureWindow.setAttribute("nextLength",
          Integer.toString(rightWindow));
      lemmaClassFeatureWindow.addContent(lemmaClassFeatureElement);
      generators.addContent(lemmaClassFeatureWindow);
      System.err.println("-> LemmaModel Features added!");
    }
    if (Flags.isLemmaDictionaryFeatures(params)) {
      setWindow(params);
      final String lemmaDictPath = Flags.getLemmaDictionaryFeatures(params);
      final String[] lemmaDictResources = Flags
          .getLemmaDictionaryResources(lemmaDictPath);
      final Element lemmaClassFeatureElement = new Element("custom");
      lemmaClassFeatureElement.setAttribute("class",
          LemmaDictionaryFeatureGenerator.class.getName());
      lemmaClassFeatureElement.setAttribute("model", IOUtils
          .normalizeLexiconName(new File(lemmaDictResources[0]).getName()));
      lemmaClassFeatureElement.setAttribute("dict", IOUtils
          .normalizeLexiconName(new File(lemmaDictResources[1]).getName()));
      final Element lemmaClassFeatureWindow = new Element("window");
      lemmaClassFeatureWindow.setAttribute("prevLength",
          Integer.toString(leftWindow));
      lemmaClassFeatureWindow.setAttribute("nextLength",
          Integer.toString(rightWindow));
      lemmaClassFeatureWindow.addContent(lemmaClassFeatureElement);
      generators.addContent(lemmaClassFeatureWindow);
      System.err.println("-> LemmaDictionary Features added!");
    }
    if (Flags.isMFSFeatures(params)) {
      setWindow(params);
      final String mfsPath = Flags.getMFSFeatures(params);
      final String[] mfsResources = Flags.getMFSResources(mfsPath);
      final String mfsRange = Flags.getMFSFeaturesRange(params);
      final String seqCodec = Flags.getSequenceCodec(params);
      final Element mfsClassFeatureElement = new Element("custom");
      mfsClassFeatureElement.setAttribute("class",
          MFSFeatureGenerator.class.getName());
      mfsClassFeatureElement.setAttribute("model",
          IOUtils.normalizeLexiconName(new File(mfsResources[0]).getName()));
      mfsClassFeatureElement.setAttribute("dict",
          IOUtils.normalizeLexiconName(new File(mfsResources[1]).getName()));
      mfsClassFeatureElement.setAttribute("mfs",
          IOUtils.normalizeLexiconName(new File(mfsResources[2]).getName()));
      mfsClassFeatureElement.setAttribute("range", mfsRange);
      mfsClassFeatureElement.setAttribute("seqCodec", seqCodec);
      final Element mfsClassFeatureWindow = new Element("window");
      mfsClassFeatureWindow.setAttribute("prevLength",
          Integer.toString(leftWindow));
      mfsClassFeatureWindow.setAttribute("nextLength",
          Integer.toString(rightWindow));
      mfsClassFeatureWindow.addContent(mfsClassFeatureElement);
      generators.addContent(mfsClassFeatureWindow);
      System.err.println("-> MFS Features added");
    }
    if (Flags.isSuperSenseFeatures(params)) {
      final String mfsPath = Flags.getSuperSenseFeatures(params);
      final String[] mfsResources = Flags.getSuperSenseResources(mfsPath);
      final String mfsRange = Flags.getSuperSenseFeaturesRange(params);
      final String seqCodec = Flags.getSequenceCodec(params);
      final Element mfsClassFeatureElement = new Element("custom");
      mfsClassFeatureElement.setAttribute("class",
          SuperSenseFeatureGenerator.class.getName());
      mfsClassFeatureElement.setAttribute("model",
          IOUtils.normalizeLexiconName(new File(mfsResources[0]).getName()));
      mfsClassFeatureElement.setAttribute("dict",
          IOUtils.normalizeLexiconName(new File(mfsResources[1]).getName()));
      mfsClassFeatureElement.setAttribute("mfs",
          IOUtils.normalizeLexiconName(new File(mfsResources[2]).getName()));
      mfsClassFeatureElement.setAttribute("range", mfsRange);
      mfsClassFeatureElement.setAttribute("seqCodec", seqCodec);
      generators.addContent(mfsClassFeatureElement);
      System.err.println("-> SuperSense Features added!");
    }
    if (Flags.isPOSBaselineFeatures(params)) {
      final String beginPrefix = Flags.getPrefixBegin(params);
      final String endPrefix = Flags.getPrefixEnd(params);
      final String beginSuffix = Flags.getSuffixBegin(params);
      final String endSuffix = Flags.getSuffixEnd(params);
      final Element posFeatureElement = new Element("custom");
      posFeatureElement.setAttribute("class",
          POSBaselineContextGenerator.class.getName());
      posFeatureElement.setAttribute("prefBegin", beginPrefix);
      posFeatureElement.setAttribute("prefEnd", endPrefix);
      posFeatureElement.setAttribute("sufBegin", beginSuffix);
      posFeatureElement.setAttribute("sufEnd", endSuffix);
      generators.addContent(posFeatureElement);
      System.err.println("-> POS Baseline Context Generator added!");
    }
    if (Flags.isLemmaBaselineFeatures(params)) {
      final String beginPrefix = Flags.getPrefixBegin(params);
      final String endPrefix = Flags.getPrefixEnd(params);
      final String beginSuffix = Flags.getSuffixBegin(params);
      final String endSuffix = Flags.getSuffixEnd(params);
      final String posModel = Flags.getLemmaBaselineFeatures(params);
      final String lemmaRange = Flags.getLemmaBaselineFeaturesRange(params);
      final Element lemmaFeatureElement = new Element("custom");
      lemmaFeatureElement.setAttribute("class",
          LemmaBaselineContextGenerator.class.getName());
      lemmaFeatureElement.setAttribute("prefBegin", beginPrefix);
      lemmaFeatureElement.setAttribute("prefEnd", endPrefix);
      lemmaFeatureElement.setAttribute("sufBegin", beginSuffix);
      lemmaFeatureElement.setAttribute("sufEnd", endSuffix);
      lemmaFeatureElement.setAttribute("model",
          IOUtils.normalizeLexiconName(new File(posModel).getName()));
      lemmaFeatureElement.setAttribute("range", lemmaRange);
      generators.addContent(lemmaFeatureElement);
      System.err.println("-> Lemma Baseline Context Generator added!");
    }
    if (Flags.isChunkBaselineFeatures(params)) {
      final String posModel = Flags.getChunkBaselineFeatures(params);
      final Element chunkFeatureElement = new Element("custom");
      chunkFeatureElement.setAttribute("class",
          ChunkBaselineContextGenerator.class.getName());
      chunkFeatureElement.setAttribute("model",
          IOUtils.normalizeLexiconName(new File(posModel).getName()));
      generators.addContent(chunkFeatureElement);
      System.err.println("-> Chunk Baseline Context Generator added!");
    }

    if (Flags.isPredicateContextFeatures(params)) {
      final String predicateContextFile = Flags
          .getPredicateContextFeatures(params);
      final Element predicateContextFeatureElement = new Element("custom");
      predicateContextFeatureElement.setAttribute("class",
          PredicateContextFeatureGenerator.class.getName());
      predicateContextFeatureElement.setAttribute("dict", IOUtils
          .normalizeLexiconName(new File(predicateContextFile).getName()));
      generators.addContent(predicateContextFeatureElement);
      System.err.println("-> Predicate Context Generator added!");
    }

    aggGenerators.addContent(cached);
    cached.addContent(generators);

    final XMLOutputter xmlOutput = new XMLOutputter();
    final Format format = Format.getPrettyFormat();
    xmlOutput.setFormat(format);
    return xmlOutput.outputString(doc);

  }
857532
static void addParameterChild(Element node, String name, String value) {
        if (node != null) {
            Document doc = node.getOwnerDocument();
            Element parm = doc.createElement(Constants.ELM_PARAMETER);
            parm.setAttribute(Constants.ATT_NAME, name);
            parm.setAttribute(Constants.ATT_VALUE, value);
            /*
             * Set the override attribute to 'yes'. This isn't persisted since
             * this is determined upon loading the layout based upon the
             * channel definition. But for code that references this in-memory
             * value like ChannelStaticData it needs to be set.
             */
            parm.setAttribute(Constants.ATT_OVERRIDE, Constants.CAN_OVERRIDE);
            node.appendChild(parm);
        }
    }
266491
public static void parseOutputParameterElement(Element outputParameterElement, IoMapping ioMapping) {
    String nameAttribute = outputParameterElement.attribute("name");
    if(nameAttribute == null || nameAttribute.isEmpty()) {
      throw new BpmnParseException("Missing attribute 'name' for outputParameter", outputParameterElement);
    }

    ParameterValueProvider valueProvider = parseNestedParamValueProvider(outputParameterElement);

    // add parameter
    ioMapping.addOutputParameter(new OutputParameter(nameAttribute, valueProvider));
  }
802309
private void validateXmlTree(Node received, Node source, 
            XmlMessageValidationContext validationContext, NamespaceContext namespaceContext, TestContext context) {
        switch(received.getNodeType()) {
            case Node.DOCUMENT_TYPE_NODE:
                doDocumentTypeDefinition(received, source, validationContext, namespaceContext, context);
                break;
            case Node.DOCUMENT_NODE:
                validateXmlTree(received.getFirstChild(), source.getFirstChild(),
                        validationContext, namespaceContext, context);
                break;
            case Node.ELEMENT_NODE:
                doElement(received, source, validationContext, namespaceContext, context);
                break;
            case Node.ATTRIBUTE_NODE:
                throw new IllegalStateException();
            case Node.COMMENT_NODE:
                validateXmlTree(received.getNextSibling(), source,
                        validationContext, namespaceContext, context);
                break;
            case Node.PROCESSING_INSTRUCTION_NODE:
                doPI(received);
                break;
        }
    }
908672
def generate_elements_clasification(bpmn_graph):
    
    nodes_classification = []
    node_param_name = "node"
    flow_param_name = "flow"
    classification_param_name = "classification"

    classification_element = "Element"
    classification_join = "Join"
    classification_split = "Split"
    classification_start_event = "Start Event"
    classification_end_event = "End Event"

    task_list = bpmn_graph.get_nodes(consts.Consts.task)
    for element in task_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    subprocess_list = bpmn_graph.get_nodes(consts.Consts.subprocess)
    for element in subprocess_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    complex_gateway_list = bpmn_graph.get_nodes(consts.Consts.complex_gateway)
    for element in complex_gateway_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    event_based_gateway_list = bpmn_graph.get_nodes(consts.Consts.event_based_gateway)
    for element in event_based_gateway_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    inclusive_gateway_list = bpmn_graph.get_nodes(consts.Consts.inclusive_gateway)
    for element in inclusive_gateway_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    exclusive_gateway_list = bpmn_graph.get_nodes(consts.Consts.exclusive_gateway)
    for element in exclusive_gateway_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    parallel_gateway_list = bpmn_graph.get_nodes(consts.Consts.parallel_gateway)
    for element in parallel_gateway_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    start_event_list = bpmn_graph.get_nodes(consts.Consts.start_event)
    for element in start_event_list:
        tmp = [classification_element, classification_start_event]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    intermediate_catch_event_list = bpmn_graph.get_nodes(consts.Consts.intermediate_catch_event)
    for element in intermediate_catch_event_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    end_event_list = bpmn_graph.get_nodes(consts.Consts.end_event)
    for element in end_event_list:
        tmp = [classification_element, classification_end_event]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    intermediate_throw_event_list = bpmn_graph.get_nodes(consts.Consts.intermediate_throw_event)
    for element in intermediate_throw_event_list:
        tmp = [classification_element]
        if len(element[1][consts.Consts.incoming_flow]) >= 2:
            tmp.append(classification_join)
        if len(element[1][consts.Consts.outgoing_flow]) >= 2:
            tmp.append(classification_split)
        nodes_classification += [{node_param_name: element, classification_param_name: tmp}]

    flows_classification = []
    flows_list = bpmn_graph.get_flows()
    for flow in flows_list:
        flows_classification += [{flow_param_name: flow, classification_param_name: ["Flow"]}]

    return nodes_classification, flows_classification
769777
function structHandlerCustom( $element, &$params )
    {
        $ret = null;
        if ( $this->XMLSchema->isInline( $element ) )
        {
            $ret = $this->appendLineParagraph( $element, $params );
        }
        else
        {
            $ret = $this->appendParagraph( $element, $params );
        }
        return $ret;
    }
941256
def process_text_h( element, output_node )
      style_name = register_style( element )
      level = element.attribute("#{@text_ns}:outline-level").value.to_i
      if (level > 6) then
        level = 6
      end
      heading = emit_element( output_node, "h" + level.to_s, {"class" => style_name} )
      process_children( element, heading )
    end
1234634
def _make_xml(self, endpoints):
        # type: (List[EndpointDescription]) -> ElementTree.Element
        
        root = ElementTree.Element(TAG_ENDPOINT_DESCRIPTIONS)
        for endpoint in endpoints:
            self._make_endpoint(root, endpoint)

        # Prepare pretty-printing
        self._indent(root)
        return root
909761
function processSubtree( $element, &$lastHandlerResult )
    {
        $ret = null;
        $tmp = null;

        // Call "Init handler"
        $this->callOutputHandler( 'initHandler', $element, $tmp );

        $debug = eZDebugSetting::isConditionTrue( 'kernel-datatype-ezxmltext', eZDebug::LEVEL_DEBUG );

        // Process children
        if ( $element->hasChildNodes() )
        {
            // Make another copy of children to save primary structure
            $childNodes = $element->childNodes;
            $childrenCount = $childNodes->length;

            // we can not loop directly over the childNodes property, because this will change while we are working on it's parent's children
            $children = array();
            foreach ( $childNodes as $childNode )
            {
                $children[] = $childNode;
            }

            $lastResult = null;
            $newElements = array();
            foreach ( $children as $child )
            {
                if ( $debug )
                {
                    eZDebug::writeDebug( 'processing children, current child: ' . $child->nodeName, eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext', __METHOD__ ) );
                }

                $childReturn = $this->processSubtree( $child, $lastResult );

                unset( $lastResult );
                if ( isset( $childReturn['result'] ) )
                {
                    if ( $debug )
                    {
                        eZDebug::writeDebug( 'return result is set for child ' . $child->nodeName, eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext', __METHOD__ ) );
                    }

                    $lastResult = $childReturn['result'];
                }

                if ( isset( $childReturn['new_elements'] ) )
                {
                    $newElements = array_merge( $newElements, $childReturn['new_elements'] );
                }

                if ( $this->QuitProcess )
                {
                    return $ret;
                }
            }

            if ( $debug )
            {
                eZDebug::writeDebug( $this->Document->saveXML(),
                                     eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                                  'XML before processNewElements for element ' . $element->nodeName ) );
            }

            // process elements created in children handlers
            $this->processNewElements( $newElements );

            if ( $debug )
            {
                eZDebug::writeDebug( $this->Document->saveXML(),
                                     eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                                  'XML after processNewElements for element ' . $element->nodeName ) );
            }
        }

        // Call "Structure handler"
        if ( $debug )
        {
            eZDebug::writeDebug( $this->Document->saveXML(),
                                 eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                              'XML before callOutputHandler structHandler for element ' . $element->nodeName ) );
        }

        $ret = $this->callOutputHandler( 'structHandler', $element, $lastHandlerResult );

        if ( $debug )
        {
            eZDebug::writeDebug( $this->Document->saveXML(),
                                 eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                              'XML after callOutputHandler structHandler for element ' . $element->nodeName ) );
            eZDebug::writeDebug( $ret,
                                 eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                              'return value of callOutputHandler structHandler for element ' . $element->nodeName ) );
        }

        // Process by schema (check if element is allowed to exist)
        if ( !$this->processBySchemaPresence( $element ) )
        {
            if ( $debug )
            {
                eZDebug::writeDebug( $this->Document->saveXML(),
                                     eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                                  'XML after failed processBySchemaPresence for element ' . $element->nodeName ) );
            }
            return $ret;
        }

        if ( $debug )
        {
            eZDebug::writeDebug( $this->Document->saveXML(),
                                 eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                              'XML after processBySchemaPresence for element ' . $element->nodeName ) );
        }

        // Process by schema (check place in the tree)
        if ( !$this->processBySchemaTree( $element ) )
        {
            if ( $debug )
            {
                eZDebug::writeDebug( $this->Document->saveXML(),
                                     eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                                  'XML after failed processBySchemaTree for element ' . $element->nodeName ) );
            }
            return $ret;
        }

        if ( $debug )
        {
            eZDebug::writeDebug( $this->Document->saveXML(),
                                 eZDebugSetting::changeLabel( 'kernel-datatype-ezxmltext',
                                                              'XML after processBySchemaTree for element ' . $element->nodeName ) );
        }


        $tmp = null;
        // Call "Publish handler"
        $this->callOutputHandler( 'publishHandler', $element, $tmp );

        // Process attributes according to the schema
        if ( $element->hasAttributes() )
        {
            if ( !$this->XMLSchema->hasAttributes( $element ) )
            {
                eZXMLInputParser::removeAllAttributes( $element );
            }
            else
            {
                $this->processAttributesBySchema( $element );
            }
        }
        return $ret;
    }
1096299
function xmlImportNode(doc, node) {
  if (node.nodeType == DOM_TEXT_NODE) {
    return domCreateTextNode(doc, node.nodeValue);

  } else if (node.nodeType == DOM_CDATA_SECTION_NODE) {
    return domCreateCDATASection(doc, node.nodeValue);

  } else if (node.nodeType == DOM_ELEMENT_NODE) {
    var newNode = domCreateElement(doc, node.nodeName);
    for (var i = 0; i < node.attributes.length; ++i) {
      var an = node.attributes[i];
      var name = an.nodeName;
      var value = an.nodeValue;
      domSetAttribute(newNode, name, value);
    }

    for (var c = node.firstChild; c; c = c.nextSibling) {
      var cn = arguments.callee(doc, c);
      domAppendChild(newNode, cn);
    }

    return newNode;

  } else {
    return domCreateComment(doc, node.nodeName);
  }
}
758283
private void processElementUniform(GeneratorSingleCluster cluster, Node cur) {
    double min = 0.0;
    double max = 1.0;

    String minstr = ((Element) cur).getAttribute(ATTR_MIN);
    if(minstr != null && minstr.length() > 0) {
      min = ParseUtil.parseDouble(minstr);
    }
    String maxstr = ((Element) cur).getAttribute(ATTR_MAX);
    if(maxstr != null && maxstr.length() > 0) {
      max = ParseUtil.parseDouble(maxstr);
    }

    // *** new uniform generator
    Random random = cluster.getNewRandomGenerator();
    Distribution generator = new UniformDistribution(min, max, random);
    cluster.addGenerator(generator);

    // TODO: check for unknown attributes.
    XMLNodeIterator iter = new XMLNodeIterator(cur.getFirstChild());
    while(iter.hasNext()) {
      Node child = iter.next();
      if(child.getNodeType() == Node.ELEMENT_NODE) {
        LOG.warning("Unknown element in XML specification file: " + child.getNodeName());
      }
    }
  }
412909
private void writeOutRequestParams(List<String> elements, Writer out) throws IOException {
		if (elements != null && elements.size() > 0) {
			for (String param : elements) {
				out.write("\n\t\t\"" + param + "\": ");
				if (param.equalsIgnoreCase("boolean")) {
					addImports = true;
					out.write("strconv.FormatBool(boolean)");
				} else if (param.equalsIgnoreCase("integer")) {
					addImports = true;
					out.write("strconv.Itoa(i)");
				} else if (param.equalsIgnoreCase("string")) {
					out.write("str");
				} else if (param.equalsIgnoreCase("type")) {
					out.write("t");
				} else {
					out.write(param.toLowerCase());
				}
				out.write(",");
			}
		}
	}
1142283
def export_event_based_gateway_info(node_params, output_element):
        
        output_element.set(consts.Consts.gateway_direction, node_params[consts.Consts.gateway_direction])
        output_element.set(consts.Consts.instantiate, node_params[consts.Consts.instantiate])
        output_element.set(consts.Consts.event_gateway_type, node_params[consts.Consts.event_gateway_type])
864360
protected void readDataOutput(org.w3c.dom.Node xmlNode, StartNode startNode) {
        String id = ((Element) xmlNode).getAttribute("id");
        String outputName = ((Element) xmlNode).getAttribute("name");
        dataOutputs.put(id, outputName);
    }
676348
def addInputPort(self, node, name,
                     i: Union[Value, RtlSignalBase],
                     side=PortSide.WEST):
        
        root = self.node
        port = node.addPort(name, PortType.INPUT, side)
        netCtxs = self.netCtxs

        if isinstance(i, LPort):
            root.addEdge(i, port)
        elif isConst(i):
            i = i.staticEval()
            c, wasThereBefore = self.netCtxs.getDefault(i)
            if not wasThereBefore:
                v = ValueAsLNode(root, i).east[0]
                c.addDriver(v)
            c.addEndpoint(port)
        elif i.hidden:
            # later connect driver of this signal to output port
            ctx, wasThereBefore = netCtxs.getDefault(i)
            if not wasThereBefore:
                self.lazyLoadNet(i)
            ctx.addEndpoint(port)
        else:
            portCtx = self.portCtx
            rootCtx, _ = self.rootNetCtxs.getDefault(i)

            if self.isVirtual:
                # later connect signal in root to input port or input port of
                # wrap node
                rootCtx.addEndpoint(port)
            else:
                # spot input port on this wrap node if required
                isNewlySpotted = (i, PortType.INPUT) not in portCtx.data
                src = portCtx.register(i, PortType.INPUT)
                # connect input port on wrap node with specified output port
                ctx, _ = netCtxs.getDefault(i)
                ctx.addDriver(src)
                ctx.addEndpoint(port)

                if isNewlySpotted:
                    # get input port from parent view
                    _port = portCtx.getOutside(i, PortType.INPUT)
                    rootCtx.addEndpoint(_port)
1282723
def add_node(namespace_inc_global, body, opts = {})
      data, _status_code, _headers = add_node_with_http_info(namespace_inc_global, body, opts)
      return data
    end