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

J S ladyslipper98201 at yahoo.com
Mon May 27 00:23:09 PDT 2002


Hi,

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/>
welcome</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 a JDOM element with a string value of 

<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!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the jdom-interest mailing list