Add Namespace Prefix To root node

Renegade

New Member
I need to change the namespace of the root node and add the namespace prefix to only root element not for child elements.I have following XML:\[code\]<?xml version="1.0" encoding="UTF-8"?> <Class xmlns="https://api.ladbrokes.com/v1/sportsbook-couchbase/SportsbookCouchbase.xsd"><blurb >Test</blurb><channels ><e >I</e><e >J</e><e >K</e></channels><classSortCode >Test</classSortCode><classStatus >Test</classStatus><creationDateTime >2013-03-21T22:29:01.58+05:30</creationDateTime><isActive >true</isActive><lastUpdatedDateTime >2013-03-21T22:29:01.58+05:30</lastUpdatedDateTime><locale >Test</locale></Class>\[/code\]And I need this to become\[code\]<?xml version="1.0" encoding="UTF-8"?> <ns0:Class xmlns:ns0="https://api.ladbrokes.com/v1/sportsbook-couchbase/Temp.xsd"><blurb >Test</blurb><channels ><e >I</e><e >J</e><e >K</e></channels><classSortCode >Test</classSortCode><classStatus >Test</classStatus><creationDateTime >2013-03-21T22:29:01.58+05:30</creationDateTime><isActive >true</isActive><lastUpdatedDateTime >2013-03-21T22:29:01.58+05:30</lastUpdatedDateTime><locale >Test</locale></ns0:Class>\[/code\]Can i achieve this using XSLT? Kindly assist me in this regard.Thanks,Siva
 
Back
Top