You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by sridhar vudutha <sr...@gmail.com> on 2008/06/14 00:12:53 UTC

Problem Removing Namespace uri & prefixes

Hello,
   I'm using xmlbeans in my project. I'm constructing xml using the xmlbeans
generated sources from the XML Schema files. The server to which I'm
communicating doesn't recognize the namespace URI's or the prefixes.
so, once the XML document is constructed, I'm trying to strip of the
namespace URI's and prefixes using the below code and couldn't get it to
work.


Map m=
*new* HashMap();

m.put(
http://www.abc.com/schemas/myproj/avail/2008/01, "");

m.put(
http://www.abc.com/schemas/myproj/common/2008/01,"");

opts.setLoadSubstituteNamespaces(m);

opts.setUseDefaultNamespace();

SampleRQDocument propAvailRQDoc = SampleRQDocument.Factory.*newInstance*
(opts);

....

The schemas are defined under 3 different namespaces.

How can I remove the Namespace URI's and Prefixes after I construct the XML
document?

Next thing, when the server sends the response, the response doesn't include
any Namespace URI or the prefixes. How can I embed the URI's and Prefixes in
the response document after I receive it so, I can use XML Beans

to bind the XML to the generated sources.

I searched a lot using google but couldn't find a suitable solution.

Any help in this regard is greatly appreciated.

Thanks,

Sridhar.