从.docx中读取theme1.xml,属性不带名称空间
Reading theme1.xml from a .docx, attribute without namespace
我正在制作一个docx阅读器(libopc和c++),当我想从theme1.xml中获得次要和主要字体时,我有问题。问题是,我不知道如何编写没有它的属性名称空间:
<a:latin typeface="Calibri"/>
我试过了:
mce_start_attribute(&reader, _X(""), _X("typeface")) {//type
_majorFont = (char*) xmlTextReaderConstValue(reader.reader);
}mce_end_attribute(&reader);
:
mce_start_attribute(&reader, _X("http://www.3w.org/2000/xmlns"), _X("typeface")) {//type
_majorFont = (char*) xmlTextReaderConstValue(reader.reader);
}mce_end_attribute(&reader);
我得到了相同的结果:没有
任何建议。
我回答自己。检查libopc源代码后,解决方案是将mce_start_attribute宏中的命名空间值设置为NULL:
mce_start_attribute(&reader, NULL, _X("typeface")) {//type
_majorFont = (char*) xmlTextReaderConstValue(reader.reader);
}mce_end_attribute(&reader);
相关文章:
- 为什么两个不同的未命名名称空间可以共存于一个cpp文件中
- 如何导出包含具有"std::unique_ptr"值的"std::map"属性的
- 命名空间中具有.h和.cpp文件的类
- 从父命名空间重载类型
- 当在同一名称空间中有两个具有相同签名的函数时,会发生什么
- 在命名空间中定义函数还是限定函数
- C++:对不存在的命名空间使用命名空间指令
- C++概念:如何使用'concept'检查模板化结构的属性?
- 通过继承类使用来自不同命名空间的运算符
- 子目录是否继承属性,例如add_definitions,include_directories和父Cmakelist.t
- 通过指向指针数组的指针访问子类的属性
- MSVC是否支持C++11样式的属性而不是__declspec
- 使用命名空间时出现多个定义错误
- OpenGL相机和相机空间转型的困惑
- C++属性命名空间
- 有没有一种方法可以创建具有广义属性的命名空间
- C++17 中命名空间的属性"deprecated"
- 为什么c++ 17向名称空间和枚举数添加属性?
- 在c++中管理带有属性的大型空间数据集
- 从.docx中读取theme1.xml,属性不带名称空间