[jdom-interest] Need help
Normadiah Mahiddin
normadiah at gmail.com
Mon Mar 19 00:24:32 PST 2007
Dear Sir/Miss/Madam,
I want to add the element together with its children.
However,I got problem during add children. I don't know why
the error said it can't find getChildren function.
In fact I already import the library needed.
Below was my code:
*import java.io.IOException;*
*import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
import java.util.*;*
*import java.io.*;
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;*
* while(itr.hasNext())
{
Element oneLevelDeep = (Element)itr.next();
if(oneLevelDeep.getName().equals("Plan"))
{
ID = oneLevelDeep.getAttributeValue ("ID");
float PID = Float.parseFloat(ID);
float NewPID = PID + 1;
String NewPIDString = Float.toString(NewPID);
Name = oneLevelDeep.getAttributeValue("Name");
Plan.setAttribute("ID",NewPIDString);
Plan.setAttribute("Name",Name);
** /*goalText = oneLevelDeep.getChildTextNormalize("Goal");
goal.setText(goalText);
Plan.addContent(goal);*/
//Plan.addContent((List)(Element) oneLevelDeep.getChildren
().clone());
//Plan.getChild();
PlansGroup.addContent ((Element) Plan.clone());
}*
The red text show that I had problem there.
Thank you very much for your help.
Regards,
Normadiah Mahiddin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20070319/43b4cb0e/attachment.htm
More information about the jdom-interest
mailing list