[jdom-interest] Adding String to Element where String contains Element in String form

J S ladyslipper98201 at yahoo.com
Fri May 24 17:38:34 PDT 2002


Hi,

Turns out my problem is simplier than previously
stated.  

I have <title id="2005"></title> as my xml.  

I do a java lookup getTitle(2005) and receive the
following text: "<javacustomtag:GetName/> welcome"

Now I want to put this text into the xml so that it
now looks like:

<title id="2005"><javacustomtag:GetName/>
welcom</title>

The problem is that the <>s are being escaped into
&lt; &gt; s

So here is my java code.

String topicTitle = "<javacustomtag:GetName/>
welcome";
Vector children = new Vector();
children.add(topicTitle);
List eChildren = e.getChildren();
eChildren = e.getChildren();
children.addAll(eChildren);
e.removeChildren();
e.setContent(children);

where e is 

<title id="2005">
<title>Hello</title>
<title></title>
<title></title>
</title>

I want the result to be

<title id="2005">
<javacustomtag:GetName/> welcome
<title>Hello</title>
<title></title>
<title></title>
</title>

Any ideas appreciated,

Jo





__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com



More information about the jdom-interest mailing list