Package org.dom4j

Examples of org.dom4j.Node.selectSingleNode()


      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


      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

                    Node node = (Node)obj;

                    ObjectProperty op = objectPropertyFactory.createObjectProperty(baseTemplate.getCampaign(), true);
                    logger.trace("op: " + op);

                    op.setName(node.selectSingleNode("@name").getStringValue());
                    try {
                        op.setTemplate(Boolean.parseBoolean(node.selectSingleNode("@template").getStringValue()));
                    }
                    catch(Exception e) {
                        // ignore
View Full Code Here

                    ObjectProperty op = objectPropertyFactory.createObjectProperty(baseTemplate.getCampaign(), true);
                    logger.trace("op: " + op);

                    op.setName(node.selectSingleNode("@name").getStringValue());
                    try {
                        op.setTemplate(Boolean.parseBoolean(node.selectSingleNode("@template").getStringValue()));
                    }
                    catch(Exception e) {
                        // ignore
                    }
                    // try {
View Full Code Here

                    // }
                    // catch(Exception e) {
                    // // ignore
                    // }
                    try {
                        op.setInstanceValueLimit(Integer.parseInt(node.selectSingleNode("@instance-limit")
                                .getStringValue()));
                    }
                    catch(Exception e) {
                        // ignore
                    }
View Full Code Here

                    // calculator
                    {
                        Node calcNode = node.selectSingleNode("calculator");
                        if(calcNode != null) {
                            op.setCalculatorType(calcNode.selectSingleNode("@type").getStringValue());
                            op.setCalculatorInputs(calcNode.selectSingleNode("@inputs").getStringValue());
                            op.setCalculatorBody(calcNode.getStringValue());
                        }
                    }
View Full Code Here

                    // calculator
                    {
                        Node calcNode = node.selectSingleNode("calculator");
                        if(calcNode != null) {
                            op.setCalculatorType(calcNode.selectSingleNode("@type").getStringValue());
                            op.setCalculatorInputs(calcNode.selectSingleNode("@inputs").getStringValue());
                            op.setCalculatorBody(calcNode.getStringValue());
                        }
                    }

                    // formatter
View Full Code Here

                    // formatter
                    {
                        Node formatterNode = node.selectSingleNode("formatter");
                        if(formatterNode != null) {
                            op.setFormatterType(formatterNode.selectSingleNode("@type").getStringValue());
                            op.setFormatterBody(formatterNode.getStringValue());
                        }
                    }

                    // validator
View Full Code Here

                    // validator
                    {
                        Node validatorNode = node.selectSingleNode("validator");
                        if(validatorNode != null) {
                            op.setValidatorType(validatorNode.selectSingleNode("@type").getStringValue());
                            op.setValidatorBody(validatorNode.getStringValue());
                        }
                    }

                    baseTemplate.addProperty(op);
View Full Code Here

    private LockOutFlag checkUserDisabled(Node responseNode) {
        try {
            Node userNode = responseNode.selectSingleNode("return");

            // Gets the username
            String username = userNode.selectSingleNode("username").getText();
            // Escape the username so that it can be used as a JID.
            username = JID.escapeNode(username);

            // Gets the enabled field
            boolean isEnabled = Boolean.valueOf(userNode.selectSingleNode("enabled").getText());
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.