I believe setSaveImplicitNamespaces is what you want.

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Dan Durkin
Sent: Wednesday, September 28, 2005 1:18 PM
To: [email protected]
Subject: Saving to xml with no namespace

Using XmlOptions.setLoadSubstituteNamespaces() I was able to parse a 
document with no namespaces.

Is there a way to do the reverse of this and take an XmlObject instance 
and save an xml file with no namespace?

the following code:

HashMap noPrefixMap = new HashMap();
noPrefixMap.put("http://foo.com/bar";, "");
XmlOptions outputOpts = new XmlOptions();
outputOpts.setSavePrettyPrint();
outputOpts.setSaveSuggestedPrefixes(noPrefixMap);
anXmlObject.save( new java.io.File("test/testout.xml" ), outputOpts);

results in no prefixes but does declare a default namespace.

<foo xmlns="http://foo.com/bar";>
   <bar/>
</foo>


Thanks,

Dan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to