Examples of selectSingleNode()


Examples of org.dom4j.Element.selectSingleNode()

        instance.setSingleCorrect(false);
      }
 
      // set min/max score
      QTIEditHelper.configureMinMaxScore(instance,
       (Element)resprocessingXML.selectSingleNode(".//decvar"));
    }   
    return instance;
  }
 
  /**
 
View Full Code Here

Examples of org.dom4j.Element.selectSingleNode()

      Element el_section = (Element) iter.next();

      // resolve sectionref into the correct sections
      if (el_section.getName().equals("sectionref")) {
        String linkRefId = el_section.attributeValue("linkrefid");
        el_section = (Element) el_section.selectSingleNode("//section[@ident='" + linkRefId + "']");
        if (el_section == null) { throw new RuntimeException("sectionref with ref '" + linkRefId + "' could not be resolved"); }
      }

      SectionContext sc = new SectionContext();
      sc.setUp(assessInstance, el_section, sw);
View Full Code Here

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

Examples of org.dom4j.XPath.selectSingleNode()

    XPath meta = rootElement.createXPath("//ns:organization");
    meta.setNamespaceURIs(nsuris);

    XPath metares = rootElement.createXPath("//ns:resources");
    metares.setNamespaceURIs(nsuris);
    Element elResources = (Element) metares.selectSingleNode(rootElement);
    if (elResources == null) throw new AssertException("could not find element resources");
   
    List resourcesList = elResources.elements("resource");
    resources = new HashMap(resourcesList.size());
    for (Iterator iter = resourcesList.iterator(); iter.hasNext();) {
View Full Code Here

Examples of org.dom4j.XPath.selectSingleNode()

    String nsuri = rootElement.getNamespace().getURI();
    nsuris.put( "ns", nsuri);

    XPath meta = rootElement.createXPath("//ns:organization");
    meta.setNamespaceURIs(nsuris);
    Element orgaEl = (Element) meta.selectSingleNode(rootElement); // TODO: accept several organizations?
    if (orgaEl == null) throw new AssertException("could not find element organization");

    XPath metares = rootElement.createXPath("//ns:resources");
    metares.setNamespaceURIs(nsuris);
    Element elResources = (Element) metares.selectSingleNode(rootElement);
View Full Code Here

Examples of org.dom4j.XPath.selectSingleNode()

    Element orgaEl = (Element) meta.selectSingleNode(rootElement); // TODO: accept several organizations?
    if (orgaEl == null) throw new AssertException("could not find element organization");

    XPath metares = rootElement.createXPath("//ns:resources");
    metares.setNamespaceURIs(nsuris);
    Element elResources = (Element) metares.selectSingleNode(rootElement);
    if (elResources == null) throw new AssertException("could not find element resources");
   
    List resourcesList = elResources.elements("resource");
    resources = new HashMap(resourcesList.size());
    for (Iterator iter = resourcesList.iterator(); iter.hasNext();) {
View Full Code Here

Examples of org.dom4j.XPath.selectSingleNode()

   * @return Element
   */
  private Element shuffle(Element item) {
    // get the render_choice
    XPath choice = DocumentHelper.createXPath(".//render_choice[@shuffle=\"Yes\"]");
    Element tel_rendchoice = (Element) choice.selectSingleNode(item);
    //if shuffle is disable, just return the item
    if (tel_rendchoice == null) return item;
    // else: we have to shuffle
    // assume: all response_label have same parent: either render_choice or a
    // flow_label
View Full Code Here

Examples of org.dom4j.XPath.selectSingleNode()

    // else: we have to shuffle
    // assume: all response_label have same parent: either render_choice or a
    // flow_label
    Element shuffleItem = item.createCopy();
    // clone the whole item
    Element el_rendchoice = (Element) choice.selectSingleNode(shuffleItem);
    //  <!ELEMENT render_choice ((material | material_ref | response_label |
    // flow_label)* ,response_na?)>
    // <!ATTLIST response_label rshuffle (Yes | No ) 'Yes' .....
    List el_labels = el_rendchoice.selectNodes(".//response_label[@rshuffle=\"Yes\"]");
    int shusize = el_labels.size();
View Full Code Here

Examples of org.dom4j.xpath.DefaultXPath.selectSingleNode()

            DefaultXPath xpath = new DefaultXPath("//j:context-param[j:param-name/text()=\"resteasy.injector.factory\"]");
            Map<String,String> namespaces = new TreeMap<String,String>();
            namespaces.put("j","http://java.sun.com/xml/ns/javaee");
            xpath.setNamespaceURIs(namespaces);

            Node node =  xpath.selectSingleNode(document);
            node.detach();
            File filteredWebXml = new File("target/test/filtered/jboss-as-7_0/WEB-INF/web.xml");
            filteredWebXml.getParentFile().mkdirs();
            FileWriter writer = null;
            try {
View Full Code Here

Examples of org.jaxen.BaseXPath.selectSingleNode()

        Element root = doc.createElement("root");
        doc.appendChild(root);
        Element child = doc.createElement("child");
        root.appendChild(child);
       
        assertEquals(child, xpath.selectSingleNode(doc));
       
    }
   
   
    public void testEvaluateWithMultiNodeAnswer() throws JaxenException {
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.