我嘗試到XML存儲到string.Is在C真的可行++我得到一個copile錯誤:存儲XML爲字符串
error: parse error before string constant
試圖如下寫一行代碼時:
string xmlString = "<animalList dnPrefix="String">
<node>
<animal ID="xxxxxxxx">
<Status>managed</Status>
<Type>ENB</Type>
<Subtype>0</Subtype>
<Version1>0.0</Version1>
<Version2>0.0</Version2>
<Name>ChicagoWest5678</Name>
<LocalName>ChicagoWest5678</LocalName>
</animal>
<animal ID ="yyyyyy">
<Status>managed</Status>
<Type>ENB</Type>
<Subtype>0</Subtype>
<Version1>0.0</Version1>
<Version2>0.0</Version2>
<Name>ChicagoWest5678</Name>
<LocalName>ChicagoWest5678</LocalName>
</animal>
</node>
</animalList> ";
有沒有比它保存到文件等任何其他方式..我不能直接存儲到一個字符串..Please就幫我的朋友...
,取決於您所使用XML做什麼,你可能也想看看了Xerces庫: http://xerces.apache.org/xerces-c/ – forsvarir 2011-04-19 07:45:48