enter code here
代码部分
xmlTextWriterPtr XMLWriter = xmlNewTextWriterFilename("example.xml",0);
xmlTextWriterStartDocument(XMLWriter, NULL, NULL, NULL);
xmlTextWriterStartElement(XMLWriter,BAD_CAST "Powersettings");
xmlTextWriterSetIndent(XMLWriter,1);
xmlTextWriterWriteElement(XMLWriter,BAD_CAST "PowerScheme",BAD_CAST "Testing");
xmlTextWriterEndElement(XMLWriter);
xmlTextWriterEndElement(XMLWriter);
xmlTextWriterEndDocument(XMLWriter);
xmlFreeTextWriter(XMLWriter);
xmlCleanupCharEncodingHandlers();
xmlCleanupParser();
这是我创建 xml 的代码,libxml2 是这里使用的库。
xml contents,
<?xml version="1.0"?>
<Powersettings>
<PowerScheme>Testing</PowerScheme>
</Powersettings>
你能帮我从我的xml中删除“”部分吗?