可能重复:
JSON <-> XML in C/C++
是否有C函数或简单的C库将XML转换为JSON?
例如,我希望该函数能够转换以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<reqTransDetails>
<token>6xPVIl83hgyhtwZ/y0azu9MwMCQVSIVj/qM=</token>
<ordering>desc</ordering>
<status>A</status>
<blockSize>999</blockSize>
<blockNo>0</blockNo>
</reqTransDetails>
致:
{
"reqTransDetails": {
"token": "6xPVIl83hgyhtwZ/y0azu9MwMCQVSIVj/qM=",
"ordering": "desc",
"status": "A",
"blockSize": "999",
"blockNo": "0"
}
}
感谢您的帮助。