將std :: string類型的XML字符串轉換爲內存中的XML對象的最有效方法是什麼?對象結構不重要,我之後是我是否需要通過字符來檢查字符串char並挑選出所有的部分或者是否有更簡單的方法?std :: string xml string to object
0
A
回答
2
最簡單的方法可能是使用庫來做到這一點。
如果你想自己做,你需要解析包含XML代碼的字符串。有很多方法可以做到這一點;最簡單的可能是一個遞歸下降解析器。
0
看看Arabica:http://www.jezuk.co.uk/cgi-bin/view/arabica在所有XML庫/包裝中,我意識到它是最友好的。
0
嘗試外籍人士,緊湊,用戶界面友好的免費: http://expat.sourceforge.net/
0
0
使用libxml2。不是一個非常複雜的庫,並且易於使用。可移植性,用C語言編寫,但與其他可用語言綁定,以及大量使用和學習的示例。
相關問題
- 1. Android ClassCastException Object [] to String []
- 2. Java | Json String to Object without Library
- 3. node.js objectmapper string to javascript object
- 4. Object(KeyEvent key)to String(Java)
- 5. Java string to xml to list
- 6. C++ std :: string和string
- 7. Base64 String to Json String
- 8. android integer-xml value to string
- 9. xml string to php頁面
- 10. org.w3c.dom.Document to XML string using Groovy
- 11. Javascript string to object reference(without eval()or indexes)
- 12. std :: string :: append(std :: string)錯誤的輸出
- 13. Linq xml to object - 如何填充集合<string>
- 14. IXMLDOMDocument2 to string javascript
- 15. boost :: format表單c-string或std :: string
- 16. ArrayBuffer to String,String to ArrayBuffer方法
- 17. ICollection <string> to string []
- 18. Angular2:Subject <string> to string
- 19. base 64 string to hexa string
- 20. boost python -python buffer to C++ std :: string
- 21. C++ builder,label.caption,std :: string to unicode conversion
- 22. ElementNSImpl to String
- 23. C++循環std :: vector <std :: map <std :: string,std :: string>>
- 24. System.InvalidCastException Double to String
- 25. std :: string和stdarg.h
- 26. ctypes python std :: string
- 27. 演員表<Object> to List <Map <String,Object >>
- 28. 將java.util.Map [String,Object]轉換爲scala.collection.immutable.Map [String,Any]
- 29. VB.Net String to double
- 30. Concat String to Int
「最有效」仍然是使用其他人已經開發和調試的庫。 – 2010-11-04 12:54:29
@peoro - *你需要解析包含XML代碼的字符串* - 真的嗎?許多XML庫將採用一個字符串並將其轉換爲對象模型格式。 MSXML將做到這一點,但它是一個使用藥片,因爲它使用COM編程隱喻。你的基本觀點是正確的,但是我確信,推薦使用哪一個也是有用的。 – 2010-11-04 13:21:21
「如果你想自己做那個」,我的意思是「如果你不想在任何XML庫上轉發」...... – peoro 2010-11-04 13:24:31