Hi,
Always used namespaces when creating elements. Add namespace
declarations as necessary to the root element.
For example:
-------------------------------------------------------------
import
org.jdom.Document;
import
org.jdom.Element;
import
org.jdom.Namespace;
import
org.jdom.output.XMLOutputter;
public class Excel {
public static void main(String[] args) throws Exception {
Namespace ns =
Namespace.getNamespace(
"urn:schemas-microsoft-com:office:spreadsheet");
Namespace o =
Namespace.getNamespace(
"o",
"urn:schemas-microsoft-com:office:office");
Element wb = new Element("Workbook", ns);
wb.addContent(new Element("OfficeStuff", o));
wb.addContent(new Element("ExcelStuff", ns));
wb.addNamespaceDeclaration(o);
new XMLOutputter(" ", true).output(new Document(wb),
System.out);
}
}
/pmn
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)