creating xml element with two namespaces using libxml APIs
I want to create an xml element having two namespace as below:
element name="Root" xmlns:xsi="myXSI" xmlns:xsd="myXSD"
I have checked out with the existing APIs, but it is not getting in this form. I am getting as
Root xmlns:xsd:xsi="myXSI" xmlns:xmlns:xsd="myXSD"
I am using this APIss as below:
xmlTextWriterWriteAttributeNS(xmlWriter, BA开发者_C百科D_CAST "xmlns:xsd", BAD_CAST "xsi" , BAD_CAST "myXSD", BAD_CAST "myXSI");
Try
xmlTextWriterWriteAttributeNS(xmlWriter, BAD_CAST "xmlns", BAD_CAST "xsi", NULL, BAD_CAST "myXSI");
xmlTextWriterWriteAttributeNS(xmlWriter, BAD_CAST "xmlns", BAD_CAST "xsd", NULL, BAD_CAST "myXSD");
精彩评论