axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanka Samaranayke <ssa...@gmail.com>
Subject Re: [Axis2] Removing namespace prefix from the OMElement
Date Sun, 26 Nov 2006 18:18:52 GMT
-----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 <onural@nortel.com> Reply-To:
> axis-user@ws.apache.org To:     <axis-user@ws.apache.org>
>
>
>
> 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message