I have an xml bean that I load an xml document by adding the namespace programatically (because the xml document never has it). XmlOptions validateOptions = new XmlOptions(); validateOptions.setErrorListener(validationErrors); HashMap ns = new HashMap(); ns.put("", "http://skywiresoftware.com/ccm/global"); validateOptions.setLoadSubstituteNamespaces(ns); xmlini = XMLINIDocument.Factory.parse(new File("war/WEB-INF/xml/global.xml"), validateOptions);
problem is, when I save the xml document, it saves the xmlns and I don't want it to. How do I save an xml document using xml beans without putting the xmlns in it? Here's the save code; XmlOptions saveOptions = new XmlOptions(); saveOptions.setUseDefaultNamespace(); xmlini.save(new File("war/WEB-INF/xml/global.xml"), saveOptions); Thx. ____________________________________________________________________________________ Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ