还有我需要的一部分xml
<content type="application/xml">
<m:properties>
<d:DirectReports m:type="Collection(Edm.String)" />
<d:DisplayName>teste</d:DisplayName>
<d:Email>teste</d:Email>
<d:IsFollowed m:type="Edm.Boolean">false</d:IsFollowed>
<d:LatestPost m:null="true" />
<d:Title>CONSULTOR TECNOLOGIA</d:Title>
</m:properties>
</content>
我有一个React应用程序,我需要获取xml的Title属性并在div中播放,我不知道我是否正确获取了xml。它必须很简单,但是我做不到。帮助谁会很感激
答案 0 :(得分:0)
对不起,我还不能添加评论。罗杰的包裹看起来不错。
这是我使用过的1个 https://www.npmjs.com/package/xml-js
如果您以此创建一个util函数来处理Promise并返回JSON,效果很好。