开发者

creating xml element with two namespaces using libxml APIs

开发者 https://www.devze.com 2023-01-02 05:03 出处:网络
I want to create an xml element having two namespace as below: element name=\"Root\" xmlns:xsi=\"myXSI\" xmlns:xsd=\"myXSD\"

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");
0

精彩评论

暂无评论...
验证码 换一张
取 消