|
The
document that XmlBeans prints out is an XML representation of the infoset, so
you can only use XmlOptions.setSave*() to alter what this representation looks
like, but in your case, you want to change the infoset itself, which is why you
need to use XmlCursor.
Radu
Thanks Yana for your
response. Closing Tag of coc:OBJECT_ID was there.. For better readability
I aligned it .. I will try with cursor to modify the document.. I
just tried to substitute the namespaces.. but it did not work.. Any idea why
following code is not working ?
XmlOptions opts = new
XmlOptions();
StringWriter writer =
new StringWriter();
xmlGeoDoc.save(writer,opts); // xmlGeoDoc is the document obj
<coin:GEOCODE
xmlns:coin="http://testdomain/coindividual">
<coin:INPUTS>
<coin:EXTERNAL_ID>18285</coin:EXTERNAL_ID>
<coin:ACTUAL_LOGICAL>false</coin:ACTUAL_LOGICAL>
</coin:INPUTS>
<coin:OUTPUTS>
<coc:OBJECT_ID xmlns:coc="http://testdomain/cocommon">
165302
</coc:OBJECT_ID>
</coin:OUTPUTS> </coin:GEOCODE>
Thanks
Kiran
-------------------------------------------------
Ph: 312 742 9630
From: Yana Kadiyska
[mailto:[EMAIL PROTECTED] Sent: Wed 6/29/2005 12:33 PM To:
[email protected] Subject: RE: suppress
namespaces
Is that your whole
instance? I don’t see a closing tag for the coc:OBJECT_ID…the option you’re
trying to uses the most commonly used URI as the default NS, but it has to
pick one of them for the purpose and coindividual seems
the right choice here .
If it is imperative
that you loose prefixes/namespaces you can use the cursor to walk your
document and modify it…I think that’s the best you can do…
--Yana
From: Kiran
Kumar [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 29, 2005 6:30
AM To:
[email protected] Subject: FW: suppress
namespaces
Hello, If anybody
has any idea on my question, please throw some light .... Appreciate your time
and help..
From: Kiran
Kumar [mailto:[EMAIL PROTECTED] Sent: Tue 6/28/2005 12:35 PM To: [email protected] Subject: suppress
namespaces
Hello, I am using
XmlBeans to generate the XML response. It generates the following response..
But I want to suppress the namespaces in the response. If you observe closely
there are 2 namespaces (/coindividual and other one /cocommon) .. If I use
XmlOptions.setUseDefaultNamespace(), it is suppressing only for
"/coindividual". Is there any way I can suppress all the namespaces ? [ Reason
I want to suppress namespaces is, I have few client applications which does
string manipulation on XML, they dont use parsers.. its a different story
]
------------------------------------------------
This e-mail, and any attachments
thereto, is confidential and is intended only for the individual(s)
named. If you are not the intended recipient, please let us know by
e-mail reply and delete it from your system; do not copy/save this e-mail or
disclose its contents to anyone. E-mail transmissions cannot be
guaranteed to be secure or error-free as the transmission could be
interrupted, corrupted, lost, destroyed, altered, arrive late or contain
viruses. ObjectWave does not accept liability for any errors or
omissions in the contents of this e-mail which arise as a result of e-mail
transmission. The views expressed in this e-mail do not necessarily
reflect those of ObjectWave or its affiliates.
------------------------------------------------
------------------------------------------------
This e-mail, and any attachments
thereto, is confidential and is intended only for the individual(s)
named. If you are not the intended recipient, please let us know by
e-mail reply and delete it from your system; do not copy/save this e-mail or
disclose its contents to anyone. E-mail transmissions cannot be
guaranteed to be secure or error-free as the transmission could be
interrupted, corrupted, lost, destroyed, altered, arrive late or contain
viruses. ObjectWave does not accept liability for any errors or
omissions in the contents of this e-mail which arise as a result of e-mail
transmission. The views expressed in this e-mail do not necessarily
reflect those of ObjectWave or its affiliates.
------------------------------------------------
|