Package org.dom4j

Examples of org.dom4j.Node


    Mode mod = ruleManager.getMode(mode);

    List list = xpath.selectNodes(input);
    Iterator it = list.iterator();
    while (it.hasNext()) {
      Node current = (Node) it.next();
      mod.fireRule(current);
    }
  }
View Full Code Here


    Mode mod = ruleManager.getMode(mode);

    List list = xpath.selectNodes(input);
    Iterator it = list.iterator();
    while (it.hasNext()) {
      Node current = (Node) it.next();
      mod.fireRule(current);
    }
  }
View Full Code Here

    if (input instanceof Element) {
      // iterate through all children
      Element element = (Element) input;
      for (int i = 0, size = element.nodeCount(); i < size; i++) {
        Node node = element.node(i);
        mod.fireRule(node);
      }
    } else if (input instanceof Document) {
      // iterate through all children
      Document document = (Document) input;
      for (int i = 0, size = document.nodeCount(); i < size; i++) {
        Node node = document.node(i);
        mod.fireRule(node);
      }
    } else if (input instanceof List) {
      List list = (List) input;
View Full Code Here

    Branch branch = getXmlBranch();
    int size = branch.nodeCount();
    List childList = new ArrayList(size);

    for (int i = 0; i < size; i++) {
      Node node = branch.node(i);

      // ignore whitespace text nodes
      if (node instanceof CharacterData) {
        String text = node.getText();

        if (text == null) {
          continue;
        }
View Full Code Here

          }
        } 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) {
            // set maxValue 0
          }
View Full Code Here

  }

  private static void detachNodes(String xPath, Document doc) {
    List xpathres = doc.selectNodes(xPath);
    for (Iterator iter = xpathres.iterator(); iter.hasNext();) {
      Node element = (Node) iter.next();
      element.detach();
    }
  }
View Full Code Here

  public int getCurrentStepNumber(String filePath) throws Exception{
   
      SAXReader reader = new SAXReader();
        Document document = reader.read(filePath+InstallationDocumentHandler.installFileName);
       
        Node node = document.selectSingleNode( "//install/step/stepnumber" );
       
        return Integer.valueOf(node.getText()).intValue();
       
  }
View Full Code Here

      Vector<StringItem> langs = new Vector<StringItem>(10,5);
      try{
      Document document = XmlUtility.parseXmlFile(this.getClass().getResource("/org/pdfsam/i18n/languages.xml"));
      List<Node> nodeList = document.selectNodes("/languages/language");
      for (int i = 0; nodeList != null && i < nodeList.size(); i++){
        Node langNode  =((Node) nodeList.get(i));
        if (langNode != null){
          langs.add(new StringItem(langNode.selectSingleNode("@value").getText(), langNode.selectSingleNode("@description").getText()));
        }
      }
    }catch(Exception e){
      log.error(GettextResource.gettext(config.getI18nResourceBundle(),"Error: "), e);
      langs.add(new StringItem("en_GB", "English (UK)"));
View Full Code Here

      configurationFilePath = configurationFile.getAbsolutePath();
      Document document = XmlUtility.parseXmlFile(configurationFile);
      if (document != null) {
        // setting up strategy
        XmlConfigStrategy strategy = null;
        Node node = document.selectSingleNode(VERSION_XPATH);
        if (node != null && "2".equals(node.getText().trim())) {
          strategy = new DefaultXmlStrategy(document);
        } else {
          strategy = new BackwardCompatibilityXmlStrategy(document);
        }
View Full Code Here

     
      if(xmlContent != null){
        try{
          SAXReader reader = new SAXReader();
        Document document = reader.read(new StringReader(xmlContent));
        Node node = document.selectSingleNode("/pdfsam/latestVersion/@value");
        if(node != null){
          retVal = node.getText().trim();
          retVal = (retVal.length()>0)? retVal: null;
        }
      }catch(Exception e){
        throw new CheckForUpdateException(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(),"Unable to get latest available version"), e);
      }     
View Full Code Here

TOP

Related Classes of org.dom4j.Node

Copyright © 2018 www.massapicom. 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.