Package org.jdom

Examples of org.jdom.Document.addContent()


        return elem;
    }
   
    public Document getXmlDocument() {
        Document doc = new Document();
        doc.addContent(toElement());
        return doc;
    }
   
    private void addDate() {
        elem.addContent(new Element("year").setText(Integer.toString(year)));
View Full Code Here


  }

  public void write() {
    Document doc = new Document();
    Element root = new Element("driverConfiguration");
    doc.addContent(root);

    for (int i = 0; i < names.size(); i++) {

      Element driver = new Element("driver");
      root.addContent(driver);
View Full Code Here

  @Override
  public void serialize( @NotNull T object, @NotNull OutputStream out ) throws IOException {
    Document document = new Document();
    //Add the format version
    document.addContent( new ProcessingInstruction( PI_TARGET_FORMAT, getFormatVersion().toString() ) );

    //Create the root
    Element root = new Element( getDefaultElementName() );
    document.setRootElement( root );
View Full Code Here

     
      Namespace schemaNS = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
      root.addNamespaceDeclaration(schemaNS);
      root.setAttribute("schemaLocation", "http://www.springframework.org/schema/beans/spring-beans.xsd", schemaNS);
     
      doc.addContent(root);     
    } else {
      SAXBuilder builder = new SAXBuilder();
      try {
        doc = builder.build(configFile.getContents(true));
      } catch (Exception e) {
View Full Code Here

          System.err.println("The element received by ingest was null");
          return;
        }
               
        Document doc = new Document();
        doc.addContent(root.detach());
       
        XPath xpathLinks;
        List<Element> aggregatedResources;
        String entryId;
    try {
View Full Code Here

    if (root == null) {
      throw new JDOMException("No root element found");
    }
   
    Document document = new Document();
    document.addContent(contents);
    document.setRootElement(root);
   
    Format format = Format.getPrettyFormat();
    format.setOmitDeclaration(true);
    format.setOmitEncoding(true);
View Full Code Here

    Element body = new Element("body", XhtmlParser.XHTML_NS);
    body.addContent(content);
    html.addContent(body);
    Document doc = new Document();
    doc.setDocType(new DocType("html",XhtmlTestCase.publicId,XhtmlTestCase.systemId));
    doc.addContent(html);
    return doc;
  }
 
  protected void buildDocument(Element content) {
    getDocument(content);
View Full Code Here

    // Document doc = builder.newDocument();
    Document d = new Document();

    Element e = new Element("error");
    e.setAttribute("target", errorString);
    d.addContent(e);

    return d;
  }

  private static XMLOutputter _xmlo = new XMLOutputter();
View Full Code Here

   * @return
   */
  private Document generateClassDocumentation(JavaClass clazz) {
    Document document = new Document();
    Element service = new Element("service");
    document.addContent(service);
    // process class commment
    if (!"".equals(clazz.getComment())) {
      service.addContent(newDocElement(clazz.getComment()));
    }
    // process methods
View Full Code Here

    Document doc = new Document();       
    Element root = new Element(PROJECT,ns);
    root.setAttribute(NAME,proj.getName(),ns);
    root.setAttribute(VERSION,String.valueOf(version),ns);
    root.setAttribute(EXPORT_DATE,DateFormat.getDateTimeInstance().format(d),ns);
    doc.addContent(root);  

    increaseProgress();
    setStatus("Writing targets",0); //$NON-NLS-1$

    root.addContent(getTargetListElement(TARGET_LIST,proj.getTargets()));   
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.