Examples of selectSingleNode()


Examples of org.dom4j.Document.selectSingleNode()

        try {
            File componentConfig = new File(componentDir, "component.xml");
            if (componentConfig.exists()) {
                SAXReader saxReader = new SAXReader();
                Document componentXML = saxReader.read(componentConfig);
                Element element = (Element)componentXML.selectSingleNode(xpath);
                if (element != null) {
                    return element.getTextTrim();
                }
            }
        }
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

    if(inputFile!=null){
      try{
        LOG.debug("Parsing xml transitions file "+inputFile.getAbsolutePath());   
        SAXReader reader = new SAXReader();
        Document document = reader.read(inputFile);
        Node rootNode = document.selectSingleNode("/transitions");
        if(rootNode != null){
          Node defType = rootNode.selectSingleNode("@defaulttype");
          Node defTransDur = rootNode.selectSingleNode("@defaulttduration");
          Node defDur = rootNode.selectSingleNode("@defaultduration");
          if(defType != null && defTransDur != null && defDur != null){
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

      //error reading qti file (existence check was made before)
      throw new AssertException("qti file could not be read " + ((LocalFileImpl)vfsQTI).getBasefile().getAbsolutePath());
    }
    // Extract min, max and cut value
    Float minValue = null, maxValue = null, cutValue = null;
    Element decvar = (Element) doc.selectSingleNode("questestinterop/assessment/outcomes_processing/outcomes/decvar");
    if (decvar != null) {
      Attribute minval = decvar.attribute("minvalue");
      if (minval != null) {
        String mv = minval.getValue();
        try {
View Full Code Here

Examples of org.dom4j.Document.selectSingleNode()

  public void setUp(AssessmentInstance assessInstance) {
    this.assessInstance = assessInstance;
    init();

    Document el_questestinterop = assessInstance.getResolver().getQTIDocument();
    el_assessment = (Element) el_questestinterop.selectSingleNode("questestinterop/assessment");

    ident = el_assessment.attributeValue("ident");
    title = el_assessment.attributeValue("title");
    Element dur = (Element) el_assessment.selectSingleNode("duration");
View Full Code Here

Examples of org.dom4j.Element.selectSingleNode()

      Element rootElement = document.getRootElement();
      String _name = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_NAME);
      String _chname = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_CHNAME);
      String _version = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_VERSION);
      String _xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_DESC);
      String _description = rootElement.selectSingleNode(_xpath).getText();
     
      _xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_LIMITTIME);
      String _limitTime = rootElement.selectSingleNode(_xpath).getText();
     
      processDefine.setProcessDefName(_name);
View Full Code Here

Examples of org.dom4j.Element.selectSingleNode()

      String _version = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_VERSION);
      String _xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_DESC);
      String _description = rootElement.selectSingleNode(_xpath).getText();
     
      _xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_LIMITTIME);
      String _limitTime = rootElement.selectSingleNode(_xpath).getText();
     
      processDefine.setProcessDefName(_name);
     
      if(_chname != null)
        processDefine.setProcessCHName(_chname);
View Full Code Here

Examples of org.dom4j.Element.selectSingleNode()

    Element rootElement = document.getRootElement();
    String name = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_NAME);
    String chname = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_CHNAME);
    String version = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_VERSION);
    String xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_DESC);
    String description = rootElement.selectSingleNode(xpath).getText();
   
    xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_LIMITTIME);
    String limitTime = rootElement.selectSingleNode(xpath).getText();
   
    processXml.setName(name);
View Full Code Here

Examples of org.dom4j.Element.selectSingleNode()

    String version = rootElement.attributeValue(StarFlowNames.FLOW_ATTR_VERSION);
    String xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_DESC);
    String description = rootElement.selectSingleNode(xpath).getText();
   
    xpath = "/ProcessDefine/ProcessProperty/".concat(StarFlowNames.FLOW_CHILD_LIMITTIME);
    String limitTime = rootElement.selectSingleNode(xpath).getText();
   
    processXml.setName(name);
   
    if(chname != null)
      processXml.setChname(chname);
View Full Code Here

Examples of org.dom4j.Element.selectSingleNode()

          }
        } else if (instance.getType() == TYPE_KPRIM) {
          instance.setSingleCorrect(false);
          float maxValue = 0;
          try {
            Node score = resprocessingXML.selectSingleNode(".//decvar[@varname='SCORE']/@maxvalue");
            if (score != null) {
              maxValue = Float.parseFloat(score.getText());
            }

          } catch (NumberFormatException e) {
View Full Code Here

Examples of org.dom4j.Element.selectSingleNode()

            }
          }
        }

        // set min/max score
        QTIEditHelper.configureMinMaxScore(instance, (Element) resprocessingXML.selectSingleNode(".//decvar"));
      }
    } catch (NullPointerException e) {
      /*
       * A null pointer exeption may occur (and has occured) due to incomplete
       * implementation of the qti specification within OLAT. Since the QTI xml
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.