Package org.jdom

Examples of org.jdom.Element.removeContent()


            return;
        }
        Element tagElem = elem.getChild(tagName, elem.getNamespace());
        if (tagElem != null) {
            String updated = CoordELFunctions.evalAndWrap(eval, tagElem.getText());
            tagElem.removeContent();
            tagElem.addContent(updated);
        }
        else {
            LOG.warn(" Value NOT FOUND " + tagName);
        }
View Full Code Here


        int index = parent.indexOf(element);

        parent.addContent(index, new Text(postpend));
        parent.addContent(index, element.removeContent());
        parent.addContent(index, new Text(prepend));
        parent.removeContent(element);
      }
    } else {
      // If it's not an element just remove the content from the document.
      Element parent = content.getParentElement();
      parent.removeContent(content);
View Full Code Here

        parent.removeContent(element);
      }
    } else {
      // If it's not an element just remove the content from the document.
      Element parent = content.getParentElement();
      parent.removeContent(content);
    }
  }

  /**
   * Wrap the given set of contents into a paragraph and place it at the
View Full Code Here

            return;
        }
        Element tagElem = elem.getChild(tagName, elem.getNamespace());
        if (tagElem != null) {
            String updated = CoordELFunctions.evalAndWrap(eval, tagElem.getText());
            tagElem.removeContent();
            tagElem.addContent(updated);
        }
        else {
            log.warn(" Value NOT FOUND " + tagName);
        }
View Full Code Here

            return;
        }
        Element tagElem = elem.getChild(tagName, elem.getNamespace());
        if (tagElem != null) {
            String updated = CoordELFunctions.evalAndWrap(eval, tagElem.getText());
            tagElem.removeContent();
            tagElem.addContent(updated);
        }
        else {
            LOG.warn(" Value NOT FOUND " + tagName);
        }
View Full Code Here

    // --- if we have a parameter specified in the config then use it instead
    // --- of the usual params
    String ptype = _config.getValue("type");
    if (ptype != null) {
      params.removeContent();
      params.addContent(new Element("type").setText(ptype));
    }

    Element result = new Element("root");
View Full Code Here

                namespaces);
        for (Object object : nodes) {
            if (object instanceof Element) {
                Element element = (Element) object;
                if(mark != null) {
                    element.removeContent();

                    // Remove attributes
                    @SuppressWarnings("unchecked")
                    List<Attribute> atts = new ArrayList<Attribute>(element.getAttributes());
                    for (Attribute attribute : atts) {
View Full Code Here

    Element node = get(id, context, null);
    if (node == null) return null;

    // remove info from the harvester we will clone
    Element info = node.getChild("info");
    if (info != null) info.removeContent();
    Element site = node.getChild("site");
    if (site != null) {
      Element name = site.getChild("name");
      if (name != null) {
        String nameStr = name.getText();
View Full Code Here

        // get the specified harvester from the settings table
        Element node = get(id, context, null);
        if (node != null) {
            Element info = node.getChild("info");
            if (info != null) {
                info.removeContent();
            }
            update(node, ownerId);
        }
    }
    /**
 
View Full Code Here

                      if(Log.isDebugEnabled(Geonet.EDITOR))
                          Log.debug(Geonet.EDITOR, "Add XML fragment; " + fragment
                              + " to element with ref: " + nodeRef + " replacing content.");
                     
                      // clean before update
                      el.removeContent();
                      fragment = addNamespaceToFragment(fragment);
                     
                      // Add content
                      Element node = Xml.loadString(fragment, false);
                      if (replaceExisting) {
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.