You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sanka Samaranayke <ss...@gmail.com> on 2006/11/26 18:44:01 UTC

[Axis2] Removing namespace prefix from the OMElement

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

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 <on...@nortel.com>
Reply-To:     axis-user@ws.apache.org
To:     <ax...@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 ?




- --
Sanka Samaranayake
WSO2 Inc.

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

iD8DBQFFadJg/Hd0ETKdgNIRAra+AJ43rBGK6xBF7w2fT/Icqq7cCo2QrwCgk0bP
s0rPB1m11Xa4Q1tXpnWvQKg=
=rLfK
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Removing namespace prefix from the OMElement

Posted by Sanka Samaranayke <ss...@gmail.com>.
-----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 <on...@nortel.com> Reply-To:
> axis-user@ws.apache.org To:     <ax...@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