Package org.jdom

Examples of org.jdom.Document.addContent()


        StringReader reader = new StringReader(xml);
        Document doc = getBuilder(false).build(reader);

        Element root = doc.getRootElement();
        doc.removeContent();
        doc.addContent(((Element)getRoot().clone()).addContent(root));
       
        Element div = doc.getRootElement().getChild("div", getNamespace("xhtml"));
        doc.getRootElement().removeContent();
        return div;
    }
View Full Code Here


        StringReader reader = new StringReader(xml);
        Document doc = getBuilder(true).build(reader);

        Element root = doc.getRootElement();
        doc.removeContent();
        doc.addContent(((Element)getRoot().clone()).addContent(root));
       
        Element div = doc.getRootElement().getChild("div", getNamespace("xhtml"));
        doc.getRootElement().removeContent();
        return div;
    }
View Full Code Here

  @Test
    public void testToMix () {
        // Construct a document using JDOM
        Document jdoc = new Document ();
        Element imgElem = new Element ("image");
        jdoc.addContent(imgElem);
       
        Element elem = new Element ("byteOrder");
        elem.addContent("big endian");
        imgElem.addContent (elem);
       
View Full Code Here

  @Test
    public void testToDocumentMD () {
        // Construct a document using JDOM
        Document jdoc = new Document ();
        Element docElem = new Element ("document");
        jdoc.addContent(docElem);

        Element elem = new Element ("isTagged");
        elem.addContent("no");
        docElem.addContent (elem);
       
View Full Code Here

    public void testToTextMD () {
        final String mln = "http://www.loc.gov/standards/mets/mets.xsd";
        // Construct a document using JDOM
        Document jdoc = new Document ();
        Element textElem = new Element ("text");
        jdoc.addContent(textElem);
       
        Element elem = new Element ("linebreak");
        elem.addContent ("LF");
        textElem.addContent (elem);
       
View Full Code Here

    Date date = new Date();
    fits.setAttribute("timestamp",dateFormat.format(date));
   
    Element identificationsection = new Element("identification",fitsNS);
    fits.addContent(identificationsection);
    mergedDoc.addContent(fits);
   
    String curSec;
    String curSecName;
   
    //check identities
View Full Code Here

                        if (wholeFile==null) {
                            System.err.println("File "+inFile+" not processed.");
                        } else {
                            Document res = new Document();
                            Element e = template.process(wholeFile);
                            res.addContent(e);
                            XMLOutputter outp = new XMLOutputter(Format.getPrettyFormat());
                            String outFn = fileNameWithSuffix(fn, outputExtension);
                            File outFile = new File(outputExtension + ".xml");
                            try {
                                BufferedWriter out = new BufferedWriter(new FileWriter(outFile));
View Full Code Here

        String comment = "DO NOT EDIT.  This file was generated by "
                + "ptolemy.domains.ptinyos.util.nc2moml.MoMLLib.  "
                + "The filename was chosen so that it does not "
                + "conflict with .nc files of the same name and any "
                + "other ptII-referenced .moml file in the classpath.";
        doc.addContent(new Comment(comment));
        doc.setRootElement(root);
        doc.setDocType(plot);

        Element group = new Element("group");
View Full Code Here

        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

        return elem;
    }
   
    public Document getXmlDocument() {
        Document doc = new Document();
        doc.addContent(toElement());
        return doc;
    }
   
    private void addTotalDonations() {
        BigDecimal totalDonated = getTotalDonated();
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.