1
A
回答
2
試試這個:
' First read your XML string in
Dim doc As XDocument = XDocument.Parse(xmlString)
' Create a string builder to hold the output CSV
Dim theOutput As New StringBuilder(1000)
' Loop through the nodes of the XML
For Each node As XElement In doc.Descendants("name of element you want to start at")
For Each innerNode As XElement In node.Elements()
theOutput.AppendFormat("{0},", innerNode.Attribute("data").Value)
Next
' Remove trailing comma
theOutput.Remove(theOutput.Length - 1, 1)
theOutput.AppendLine()
Next
' Write output to file and do whatever you want the file here
File.WriteAllText("path to file.csv", theOutput.ToString())
+0
昏暗的xmlString作爲字符串= 「一個兩
+0
你得到了什麼錯誤? –
相關問題
- 1. 將csv轉換爲字符串變量
- 2. 將類轉換爲XML爲字符串
- 3. 將XML字符串轉換爲ArrayList
- 4. 如何將字符串轉換爲xml
- 5. 將XML轉換爲字符串[]幫助
- 6. Powershell:將XML轉換爲字符串
- 7. 將XML字符串轉換爲JSON
- 8. 將字符串轉換爲XML
- 9. 將XML對象轉換爲字符串
- 10. 將xml節點轉換爲字符串
- 11. 將XML轉換爲字符串
- 12. 將字符串從xml轉換爲DateTime
- 13. 將字符串轉換爲XML文件
- 14. 將字符串列表轉換爲xml
- 15. 將xml轉換爲純字符串
- 16. 將字符串值轉換爲xml
- 17. 將GWT xml.client.Document轉換爲XML字符串
- 18. 將XML文檔轉換爲字符串?
- 19. 將字符串轉換爲xml文件?
- 20. 將對象轉換爲XML字符串
- 21. 將xml DOMDocument轉換爲字符串
- 22. 將字符串轉換爲xml節點
- 23. 將CSV字符串[]轉換爲字符串[] []
- 24. asp.net將CSV字符串轉換爲字符串[]
- 25. 將XML字符串轉換爲CSV文件(Java) - > CSV結果爲空
- 26. 將json字符串轉換爲iphone中的xml字符串
- 27. VBScript將XML轉換爲CSV
- 28. XLST將XML轉換爲CSV
- 29. 將字符串轉換爲字符串
- 30. 將字符串轉換爲字符串
如果你想XML轉換爲CSV沒有一個直接轉換爲XML允許更多。並非所有的行都需要相同。可以有多個價值。 – Paparazzi