This means you are setting Styles to NO NAMESPACE.
You probably want to use the one defined at the top of the Workbook for "".


Define the Namespace/QName as...

Namespace ns = Namespace.get("", "urn:schemas-microsoft-com:office:spreadsheet");
QName stylesQN = QName.get("Styles",ns);
styles = wb.addElement(stylesQN);



David Thielen wrote:
Hi;



I have a root node with a number of namespaces including one with no prefix:

      wb = doc.addElement("Workbook");

      wb.addNamespace("", "urn:schemas-microsoft-com:office:spreadsheet");

      wb.addNamespace("o", "urn:schemas-microsoft-com:office:office");

      wb.addNamespace("x", "urn:schemas-microsoft-com:office:excel");

      wb.addNamespace("ss", "schemas-microsoft-com:office:spreadsheet");

      wb.addNamespace("html", "http://www.w3.org/TR/REC-html40";);



When I add an element to that element, I get:

      styles = wb.addElement("Styles");  è <Styles xmlns="">



How can I get rid of the xmlns=""?



Thanks - dave



--

+------------------------------------------------------------+
| David Lucas                      mailto: ddlucas @ lse.com |
| Lucas Software Engineering, Inc.   (740) 964-6248 Voice    |
| Unix,Java,C++,CORBA,XML,EJB        (614) 668-4020 Mobile   |
| Middleware,Frameworks              (888) 866-4728 Fax/Msg  |
+------------------------------------------------------------+
| GPS Location:  40.0150 deg Lat,  -82.6378 deg Long         |
| IMHC: "Jesus Christ is the way, the truth, and the life."  |
| IMHC: "I know where I am; I know where I'm going."    <><  |
+------------------------------------------------------------+

Notes: PGP Key Block=http://www.lse.com/~ddlucas/pgpblock.txt
IMHO="in my humble opinion" IMHC="in my humble conviction"
All trademarks above are those of their respective owners.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to