Create root XML node with more than 1 namespace



I am working with Backbone.js with Restful services. Have to post XML. I want to add more than 1 namespace


Current JS code is like,



var nsp = "xmlns='http://ift.tt/19n5AFC'";
var nsp2 = "xmlns:ns2='http://ift.tt/19n5AFE'";

var doc = document.implementation.createDocument(nsp, "ns2:subscription", "");


But i expect XML root node is like,



<ns2:subscription xmlns='http://ift.tt/19n5AFC'
xmlns:ns2='http://ift.tt/19n5AFE'>..</ns2:subscription>


Thanks in advance.


No comments:

Post a Comment