Package org.dom4j

Examples of org.dom4j.Element.selectNodes()


    if (sectionItems.size() == 0) return false;
   
   
    for (Iterator iter = sectionItems.iterator(); iter.hasNext();) {
      Element it = (Element) iter.next();
      List sv = it.selectNodes("resprocessing/outcomes/decvar[@varname='SCORE']");
      // the QTIv1.2 system relies on the SCORE variable of items
      if (sv.size()!=1) return false;
    }
   
    return true;
View Full Code Here


      if (fPoints != 0) {
        Element conditionvar = el_resp_condition.element("conditionvar");
        Element and = conditionvar.element("and");
        // in and are all choices that are true

        List tmp_points = (and == null) ? conditionvar.selectNodes(".//varequal") : and.selectNodes(".//varequal");
        for (Iterator iter = tmp_points.iterator(); iter.hasNext();) {
          Element el_varequal = (Element) iter.next();
          if (type == Question.TYPE_SC || type == Question.TYPE_MC || type == Question.TYPE_KPRIM) points.put(el_varequal.getTextTrim(), new Float(fPoints));
          else if (type == Question.TYPE_FIB) points.put(el_varequal.attributeValue("respident"), new Float(fPoints));
        }
View Full Code Here

    for (Iterator i = response_labels.iterator(); i.hasNext();) {
      ChoiceResponse choice = new ChoiceResponse();
      Element response_label = (Element) i.next();
      choice.setIdent(response_label.attributeValue("ident"));

      List materials = response_label.selectNodes(".//material");
      Material content = new Material();
      for (Iterator iter = materials.iterator(); iter.hasNext();) {
        Element el_material = (Element) iter.next();
        Material mat = (Material) parserManager.parse(el_material);
        content.getElements().addAll(mat.getElements());
View Full Code Here

        Element el_item = itemc.getEl_item();
        Map res_responsehash = new HashMap(3);

        // iterate over all responses of this item
        List resps = el_item.selectNodes(".//response_lid|.//response_xy|.//response_str|.//response_num|.//response_grp");
        for (Iterator it_resp = resps.iterator(); it_resp.hasNext();) {
          Element resp = (Element) it_resp.next();
          String ident = resp.attributeValue("ident");
          String rcardinality = resp.attributeValue("rcardinality");
          String rtiming = resp.attributeValue("rtiming");
View Full Code Here

      //not <!ELEMENT order (order_extension?)>
      //<!ATTLIST order order_type CDATA #REQUIRED >
      //<!ELEMENT selection_number (#PCDATA)>
      //not <!ELEMENT sequence_parameter (#PCDATA)>
      //not <!ATTLIST sequence_parameter %I_Pname; >
      List el_selections = el_selordering.selectNodes("selection");

      // iterate over all selection elements : after each we have some items to
      // add to the run-time-section
      for (Iterator it_selection = el_selections.iterator(); it_selection.hasNext();) {
        List selectedItems;
View Full Code Here

      scoremodel = el_outpro.attributeValue("scoremodel");
      // may be null -> then assume SumOfScores

      // set the cutvalue if given (only variable score)
      cutvalue = QTIHelper.getIntAttribute(el_outpro, "outcomes/decvar[@varname='SCORE']", "cutvalue");
      List el_oft = el_outpro.selectNodes("outcomes_feedback_test");
      if (el_oft.size() != 0) {
        feedbacktesting = true;
      }
    }
  }
View Full Code Here

            }

            /*
             * process the nodes
             */
            List nodes = e.selectNodes("nodes/*");

            it = nodes.iterator();

            while(it.hasNext()) {

View Full Code Here

            while(it.hasNext()) {

                digestNode(graph,(Element) it.next());
            }

            List conns = e.selectNodes("connections/*");

            it = conns.iterator();

            while(it.hasNext()) {

View Full Code Here

            //TODO create a service on CS to get only the username field
            String path = SEARCH_URL_PREFIX + "searchProfile";
            Element element = ClearspaceManager.getInstance().executeRequest(POST, path, paramsE.asXML());

            List<Node> userNodes = (List<Node>) element.selectNodes("return");
            for (Node userNode : userNodes) {
                String username = userNode.selectSingleNode("username").getText();
                // Escape the username so that it can be used as a JID.
                username = JID.escapeNode(username);
                // Encode potentially non-ASCII characters
View Full Code Here

            //TODO create a service on CS to get only the username field
            String path = SEARCH_URL_PREFIX + "searchProfile";
            Element element = ClearspaceManager.getInstance().executeRequest(POST, path, paramsE.asXML());

            List<Node> userNodes = (List<Node>) element.selectNodes("return");
            for (Node userNode : userNodes) {
                String username = userNode.selectSingleNode("username").getText();
                // Escape the username so that it can be used as a JID.
                username = JID.escapeNode(username);
                // Encode potentially non-ASCII characters
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.