-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sanka Samaranayke wrote:
> Reposting with the appropriate prefix.
>
> --Sanka
>
> -------- Original Message -------- Subject:     Removing namespace
> prefix from the OMElement Date:     Sat, 25 Nov 2006 18:46:13 -0500
>  From:     Gul Onural <[EMAIL PROTECTED]> Reply-To:
> [email protected] To:     <[email protected]>
>
>
>
> Removing namespace prefix from the OMElement
>
> Using RawXMLMessageReceiver, my service receives and OMElement as
> input message. OMElement children has namespace prefix :
>
> <myPrefix:name>XXX</myPrefix:name>
>
> Is there a way to remove the namespace prefix from OMElement and
> all its children, programmatically ?

IFAIK you can do it only at the creation time of the OMElement.

E.g.

OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns1 = factory.createOMNamespace("http://test1.com";, "t1");
OMElement p1 = factory.createOMElement("parent",ns1);

OMNamespace ns2 = factory.createOMNamespace("http://test1.com";, "t2");
OMElement c1 = factory.createOMElement("child", ns2);
p1.addChild(c1);

p1.serialize(System.out);

will give the following output.
<t1:parent xmlns:t1="http://test1.com";><t2:child
xmlns:t2="http://test1.com"; /></t1:parent>

>
>
>
>
>
> -- Sanka Samaranayake WSO2 Inc.
>
> http://sankas.blogspot.com/ http://www.wso2.net/

- --
Sanka Samaranayake
WSO2 Inc.

http://sankas.blogspot.com/
http://www.wso2.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFFadqM/Hd0ETKdgNIRAkJBAKCCP5GiJjCyeonIHsm3SbVo3m2+4ACfUCMB
1ss3hy/AL3yovXlaifQyWDk=
=yOwC
-----END PGP SIGNATURE-----

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

Reply via email to