-1

hi we want to write xml in which we want to insert

<measType p="1">RRC.ConnEstabAtt.Cause</measType>

we are using

xmlTextWriterWriteFormatElement(writer, BAD_CAST "measType", "%s", "RRC.ConnEstabAtt.Cause");

but it simply print output as

<measType>RRC.ConnEstabAtt.Cause</measType>
4

1 回答 1

0

看起来您正在使用 libxml2,您必须使用几个不同的指令来获取属性。(请参阅http://www.xmlsoft.org/html/libxml-xmlwriter.html)尝试类似:

xmlTextWriterStartElement(writer, "measType");
xmlTextWriterWriteAttribute(writer, "p", "1");
xmlTextWriterWriteString("RRC.ConnEstabAtt.Cause");
xmlTextWriterEndElement(writer);

干杯,彼得。

于 2013-01-10T09:42:25.317 回答