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]

Reply via email to