Hi Kalyani, You can use script mediator to do this [1].
However best I think is to add the elements as needed rather than adding them and deleting them. You can try the enrich mediator or script mediator again to add xml tags. [2] [1] http://mrmalakasilva.blogspot.com/2014/03/how-to-remove-xml-elements-using-script.html [2] https://docs.wso2.com/display/ESB490/Script+Mediator On Fri, Mar 11, 2016 at 1:28 PM, Kalyani Yogeswaranathan <[email protected]> wrote: > Hi All, > > I'm working on Google contacts connector. For create Contact method we > need to set the request format as, > > <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" > xmlns:gd="http://schemas.google.com/g/2005"> > <atom:category scheme="http://schemas.google.com/g/2005#kind" > term="http://schemas.google.com/contact/2008#contact"/> > <atom:content type="text">$1</atom:content> > <gd:name> > <gd:givenName>$2</gd:givenName> > <gd:familyName>$3</gd:familyName> > <gd:fullName>$4</gd:fullName> > </gd:name> > <gd:email rel="http://schemas.google.com/g/2005#work" > primary="true" > address="$ctx:workEmail" displayName="E. Bennet"/> > <gd:email rel="http://schemas.google.com/g/2005#home" > address="$ctx:homeEmail"/> > <gd:phoneNumber rel="http://schemas.google.com/g/2005#work" > primary="true">$7</gd:phoneNumber> > <gd:phoneNumber > rel="http://schemas.google.com/g/2005#home">$8</gd:phoneNumber> > <gd:structuredPostalAddress > rel="http://schemas.google.com/g/2005#work" > primary="true"> > <gd:city>$9</gd:city> > <gd:street>$10</gd:street> > <gd:region>$11</gd:region> > <gd:postcode>$12</gd:postcode> > <gd:country>$13</gd:country> > <gd:formattedAddress>$14</gd:formattedAddress> > </gd:structuredPostalAddress> > </atom:entry> > > Here some parameters are optional. If it is optional parameter and value > is not set, it's not needed in the request. for example, > givenName is optional and it's null, then request should be as, > > <gd:name> > <gd:familyName>$3</gd:familyName> > <gd:fullName>$4</gd:fullName> > </gd:name> > > Here each element has name-space. How can I remove this kind of element from > payload? > > Any guide on this? > > > -- > > *Kalyani Yogeswaranathan* > > *Associate software engineer* > *WSO2 Inc.* > > *Mobile: 0776390284 <0776390284>* > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Best Regards, Malaka Silva Senior Tech Lead M: +94 777 219 791 Tel : 94 11 214 5345 Fax :94 11 2145300 Skype : malaka.sampath.silva LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77 Blog : http://mrmalakasilva.blogspot.com/ WSO2, Inc. lean . enterprise . middleware http://www.wso2.com/ http://www.wso2.com/about/team/malaka-silva/ <http://wso2.com/about/team/malaka-silva/> https://store.wso2.com/store/ Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
