Package org.jdom

Examples of org.jdom.Element.detach()


      Iterator it = list.iterator();
      while (it.hasNext()) {
        Element e = (Element) it.next();
        if (e.getAttributeValue("day") != null && e.getAttributeValue("day").equalsIgnoreCase(day) &&
            e.getAttributeValue("which") != null && e.getAttributeValue("which").equals(which)) {
          e.detach();

          // remove empty tag
          boolean isEmpty = true;
          List _list = _runtime.getChildren("monthdays");
          for(int i = 0; i < _list.size(); i++) {
View Full Code Here


      SAXBuilder builder = new SAXBuilder(false);
      Document doc;

      doc = builder.build(bai);
      Element r = doc.getRootElement();
      r.detach();
      _config.addContent(r);
      _dom.setChanged(true);
      _main.updateOrders();
    } catch (JDOMException e1) {
      try {
View Full Code Here

      List list = _runtime.getChildren(_elementName[_type]);;
      Iterator it = list.iterator();
      while (it.hasNext()) {
        Element e = (Element) it.next();
        if (e.getAttributeValue("month") != null && e.getAttributeValue("month").equals(month)) {
          e.detach();

          // remove empty tag
          if (list.size() == 0)
            _runtime.removeChild(_elementName[_type]);
View Full Code Here

        //if(e.getName().equals("day")) {
        if (e.getName().equals("day") &&
            (e.getAttributeValue("day") != null && (e.getAttributeValue("day").equals("" + getDayNumber(day))
                || e.getAttributeValue("day").equals(day) || e.getAttributeValue("day").equals(getDayGroupNumbers(day))))) {
          e.detach();



          // remove empty tag
          boolean isEmpty = true;
View Full Code Here

  public boolean deleteCommands(Table table) {
    int index = table.getSelectionIndex();
    if (index >= 0) {
      TableItem item = table.getItem(index);
      Element e = (Element) item.getData();
      e.detach();
      _dom.setChanged(true);
      _dom.setChangedForDirectory("job", Utils.getAttributeValue("name",_job), SchedulerDom.MODIFY);
      table.remove(index);
      _main.updateCommands();
View Full Code Here

      List listOfElement = x.selectNodes(detailListener.getDoc());

      if(!listOfElement.isEmpty()) {

        Element process = (Element)listOfElement.get(0);
        process.detach();
        detailListener.save();     
      }
    } catch (Exception e)  {

      try {
View Full Code Here

            Element meta = null;
            List ls = rootMeta.getChildren();
            if (! ls.isEmpty()) {
                meta = (Element) ls.get(0);
            }
            xmlDoc.getRootElement().addContent(meta.detach());
            xmlDoc.getRootElement().addNamespaceDeclaration(NS_DC);
        } catch (JDOMException e) {
            logger.error(e.getMessage());
        } catch (IOException e) {
            logger.error(e.getMessage());
View Full Code Here

    static Entry readFeedEntry(String feedType, Reader reader) throws JDOMException, IOException, IllegalArgumentException,
        FeedException {
        SAXBuilder builder = new SAXBuilder();
        Document document = builder.build(reader);
        Element root = document.getRootElement();
        root.detach();
        Feed feed = new Feed();
        feed.setFeedType(feedType);
        WireFeedOutput wireFeedOutput = new WireFeedOutput();
        document = wireFeedOutput.outputJDom(feed);
        document.getRootElement().addContent(root);
View Full Code Here

    Attribute attSchema = new Attribute("schemaLocation", "http://www.goobi.org/logfile" + " XML-logfile.xsd", xsi);
    root.setAttribute(attSchema);
    for (Prozess p : processList) {
      Document doc = createDocument(p, false);
      Element processRoot = doc.getRootElement();
      processRoot.detach();
      root.addContent(processRoot);
    }

    XMLOutputter outp = new XMLOutputter();
    outp.setFormat(Format.getPrettyFormat());
View Full Code Here

        throws JDOMException, IOException, IllegalArgumentException, FeedException {
        // Parse entry into JDOM tree
        SAXBuilder builder = new SAXBuilder();
        Document entryDoc = builder.build(rd);
        Element fetchedEntryElement = entryDoc.getRootElement();
        fetchedEntryElement.detach();
       
        // Put entry into a JDOM document with 'feed' root so that Rome can handle it
        Feed feed = new Feed();
        feed.setFeedType(FEED_TYPE);
        WireFeedOutput wireFeedOutput = new WireFeedOutput();
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.