[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

DOM4J and text placement in XML

Posted on 2004-11-30
2
Medium Priority
?
182 Views
Last Modified: 2010-03-31
Using DOM4J in Java, if i want this:
<george>
   <cool>true</cool>
</george>

I can go:
Element george = new Element("george")
Element git = new Element("cool")
cool.setText("true");
george.add(cool);

BUT, what do i do if I want to do this:
<george>
    true<cool/>very
 </george>

How can this be achieved?
0
Comment
Question by:blackfrancis75
2 Comments
 
LVL 19

Accepted Solution

by:
ramazanyich earned 2000 total points
ID: 12713640
did you try that:
Element george=new Element("george");
Text t1=new Text("true");
george.add(t1);
Element cool=new Element("cool");
george.add(cool);
Text t2=new Text("very");
george.add(t2);
0
 
LVL 5

Author Comment

by:blackfrancis75
ID: 12722504
hmm, that seems to produce:

<george>
    truevery<cool/>
 </george>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month18 days, 6 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question