2
我有这个结果的QString从http请求,我需要做的是只提取字符串为QString“一致”,这是标签提取从XML标签
"TranslatedText>一致</TranslatedText>"
内如何做到这一点?
<GetTranslationsResponse xmlns="http://schemas.datacontract.org/2004/07/Microsoft.MT.Web.Service.V2" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<From>en</From>
<Translations>
<TranslationMatch>
<Count>0</Count>
<MatchDegree>100</MatchDegree>
<MatchedOriginalText/>
<Rating>5</Rating>
<TranslatedText>一致</TranslatedText>
</TranslationMatch>
</Translations>
你能解释一下如何使用它吗? –
调查带有C++的XPath ... XPath查询会为您提供您要求的字符串。看看QTXML。 – monksy
所以你可以给我提供使用XPath的代码,而不仅仅是它的查询吗? –