Maarten, Sure thing. I just use:
DOMDocumentFactory factory = new DOMDocumentFactory(); d = factory.createDocument(); I need a org.dom4j.dom.DOMDocument rather than merely a org.dom4j.Document, because my XML files have mixed content, and, as I far as I understand (I easily could be wrong), Document doesn't support mixed content. If add elements programmatically, the serialization strips the prefixes and leaves only the xmlns tag such that: <prefix:name xmlns:prefix="someuri"> becomes: <name xmlns="someuri"> If I read an XML file with something like: SAXReader xmlReader = new SAXReader(DOMDocumentFactory.getInstance()); Document d = xmlReader.read(f); I receive the "Warning: missing namespace ignored: prefix" and the parsed document is again stripped down to: <name xmlns="someuri"> Thanks so much for helping out. Cheers, Ara --- Maarten Coene <[EMAIL PROTECTED]> wrote: > Hi Ara, > > could you provide us some code that illustrates how > you create your dom4j document (variable d in your > example) > > thanks > Maarten > > Ara Vartanian <[EMAIL PROTECTED]> wrote: > I'm using dom4j 1.5 and I'm having a problem when > serializing tags of the form: > > > > > with code like: > > OutputFormat outformat = > OutputFormat.createPrettyPrint(); > XMLWriter writer = new XMLWriter(new > FileOutputStream(f), > outformat); > writer.write(d); > writer.flush(); > > The output is stripped down to . > I've searched around the the web and this mailing > list's archives and haven't found anything > explaining > this. Also, I'm receiving a "Warning: missing > namespace ignored: xxx" message as the XML is being > parsed. Any help would be greatly appreciated. I've > been poking around for a few days, and I can't > figure > out what's going on. > > Yrs, > > Ara V. > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail Address AutoComplete - You start. We > finish. > http://promotions.yahoo.com/new_mail > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for > FREE > LinuxWorld Reader's Choice Award Winner for best > database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > dom4j-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/dom4j-user > > > > --------------------------------- > Do you Yahoo!? > Yahoo! Mail – CNET Editors' Choice 2004. Tell them > what you think. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user