Package org.dom4j

Examples of org.dom4j.Element.clearContent()


    }
   
    public void clearLastUpdated(String dbKey) {
        Element dbElement = fetchDBElement(dbKey);
        Element lastUpdateElement = dbElement.element("lastupdate");
        lastUpdateElement.clearContent();
        try {
            writeConfigDoc();
        } catch (IOException e) {
            _core.getLog().error("Cannot clear lastUpdate for db '" + dbKey + "' in indexConfigFile '" + _configFile.getPath() + "'." , e);
        }       
View Full Code Here


    Element element = (Element) document.selectSingleNode( xPath );
    if ( element == null ) {
      element = DocumentHelper.makeElement( document, xPath );
    }
    if ( useCData ) {
      element.clearContent();
      element.addCDATA( value );
    } else {
      element.setText( value );
    }
  }
View Full Code Here

    Element element = (Element) document.selectSingleNode( xPath );
    if ( element == null ) {
      element = DocumentHelper.makeElement( document, xPath );
    }
    if ( useCData ) {
      element.clearContent();
      element.addCDATA( value );
    } else {
      element.setText( value );
    }
  }
View Full Code Here

    Element element = (Element) document.selectSingleNode( xPath );
    if ( element == null ) {
      element = DocumentHelper.makeElement( document, xPath );
    }
    if ( useCData ) {
      element.clearContent();
      element.addCDATA( value );
    } else {
      element.setText( value );
    }
  }
View Full Code Here

    if (elem == null) {
      // Missing, we add it
      elem = xmlDoc.getRootElement().addElement(
          new QName(KEYWORD_CATEGORY, namespaceCoreProperties));
    } else {
      elem.clearContent();// clear the old value
    }
    elem.addText(propsPart.getCategoryProperty().getValue());
  }

  /**
 
View Full Code Here

    if (elem == null) {
      // Missing, we add it
      elem = xmlDoc.getRootElement().addElement(
          new QName(KEYWORD_CONTENT_STATUS, namespaceCoreProperties));
    } else {
      elem.clearContent();// clear the old value
    }
    elem.addText(propsPart.getContentStatusProperty().getValue());
  }

  /**
 
View Full Code Here

    if (elem == null) {
      // Missing, we add it
      elem = xmlDoc.getRootElement().addElement(
          new QName(KEYWORD_CONTENT_TYPE, namespaceCoreProperties));
    } else {
      elem.clearContent();// clear the old value
    }
    elem.addText(propsPart.getContentTypeProperty().getValue());
  }

  /**
 
View Full Code Here

    if (elem == null) {
      // missing, we add it
      elem = xmlDoc.getRootElement().addElement(
          new QName(KEYWORD_CREATED, namespaceDcTerms));
    } else {
      elem.clearContent();// clear the old value
    }
    elem.addAttribute(new QName("type", namespaceXSI), "dcterms:W3CDTF");
    elem.addText(propsPart.getCreatedPropertyString());
  }
View Full Code Here

    if (elem == null) {
      // missing, we add it
      elem = xmlDoc.getRootElement().addElement(
          new QName(KEYWORD_CREATOR, namespaceDC));
    } else {
      elem.clearContent();// clear the old value
    }
    elem.addText(propsPart.getCreatorProperty().getValue());
  }

  /**
 
View Full Code Here

    if (elem == null) {
      // missing, we add it
      elem = xmlDoc.getRootElement().addElement(
          new QName(KEYWORD_DESCRIPTION, namespaceDC));
    } else {
      elem.clearContent();// clear the old value
    }
    elem.addText(propsPart.getDescriptionProperty().getValue());
  }

  /**
 
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.