Package org.dom4j

Examples of org.dom4j.Element.elements()


    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();) {
      Element elRes = (Element) iter.next();
      String identVal = elRes.attributeValue("identifier");
      String hrefVal = elRes.attributeValue("href");
View Full Code Here


  private String getQuestionPreview(Item theItem) {
    Element el = DocumentFactory.getInstance().createElement("dummy");
    theItem.addToElement(el);
    StringBuilder sb = new StringBuilder();
    org.olat.ims.qti.container.qtielements.Item foo = new org.olat.ims.qti.container.qtielements.Item((Element) el.elements().get(0));
    foo.render(sb, renderInstructions);
    String previewWithFormattedMathElements = Formatter.formatLatexFormulas(sb.toString());
    Filter filter = FilterFactory.getBaseURLToMediaRelativeURLFilter(qtiPackage.getMediaBaseURL());
    return filter.filter(previewWithFormattedMathElements);
  }
View Full Code Here

      result.setConfigURL(StringUtils.strip(
          root.elementText("plugin-config-url")));
    }
    StringBuffer header = new StringBuffer();
    if (root.element("header-javascript") != null) {
      for (Element e : (List<Element>)root.elements("header-javascript")) {
        header.append("<script type=\"text/javascript\" src=\"/file/plugins/")
          .append(result.getName()).append("/").append(e.getText())
          .append("\"></script>\n");
      }
    }
View Full Code Here

          .append(result.getName()).append("/").append(e.getText())
          .append("\"></script>\n");
      }
    }
    if (root.element("header-css") != null) {
      for (Element e : (List<Element>)root.elements("header-css")) {
        header.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"/file/plugins/")
          .append(result.getName()).append("/").append(e.getText())
          .append("\"/>\n");
      }
    }
View Full Code Here

    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();) {
      Element elRes = (Element) iter.next();
      String identVal = elRes.attributeValue("identifier");
      String hrefVal = elRes.attributeValue("href");
View Full Code Here

    SAXReader reader = new SAXReader();
    try {
      Document doc = reader.read(configurationFile);
      Element rootElement = doc.getRootElement();
      List<Element> lstInst = rootElement.elements(ELEM_INSTITUTION);
      for( Element instElem : lstInst ) {
        String inst = instElem.attributeValue(ATTR_INSTITUTION_NAME);
        List<Element> lstTmpLinks = instElem.elements(ELEM_LINK);
        List<PortletLink> lstLinks = new ArrayList<PortletLink>(lstTmpLinks.size());
        for( Element linkElem: lstTmpLinks ) {
View Full Code Here

      instance.setResponses(choices);

      Element resprocessingXML = item.element("resprocessing");
      if (resprocessingXML != null) {

        List respconditions = resprocessingXML.elements("respcondition");
        HashMap points = QTIEditHelper.fetchPoints(respconditions, instance.getType());

        // postprocessing choices
        for (Iterator i = choices.iterator(); i.hasNext();) {
          ChoiceResponse choice = (ChoiceResponse) i.next();
View Full Code Here

    }
   
    Element resprocessingXML = item.element("resprocessing");
    if (resprocessingXML != null) {
     
      List respconditions = resprocessingXML.elements("respcondition");
      HashMap points = QTIEditHelper.fetchPoints(respconditions, instance.getType());
   
      // postprocessing choices
      for(Iterator i = responses.iterator(); i.hasNext();) {
        FIBResponse fibResp = (FIBResponse)i.next();   
View Full Code Here

    if (version != VERSION) {
      // complain about version conflict or solve it
      throw new OLATRuntimeException("Could not load glossary entries due to version conflict. Loaded version was::" + version, null);
    }
    // parse text marker objects and put them into a list
    List markersElements = root.elements("textMarker");
    List<TextMarker> markers = new ArrayList<TextMarker>();
    Iterator iter = markersElements.iterator();
    while (iter.hasNext()) {
      Element textMarkerElement = (Element) iter.next();
      TextMarker textMarker = new TextMarker(textMarkerElement);
View Full Code Here

        }
        else if ( name.startsWith( "is" ) ) {
          properties.add( Introspector.decapitalize( name.substring( "is".length() ) ) );
        }
      }
      for ( Element subelement : (List<Element>) element.elements() ) {
        String propertyName = subelement.attributeValue( "name" );
        if ( !properties.contains( propertyName ) ) {
          LOG.propertyNotFound( StringHelper.qualify( className, propertyName ) );
        }
      }
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.