XML Visual Basic帮助 [英] Help with XML Visual Basic
本文介绍了XML Visual Basic帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我不知道如何解释我想要什么,但我会尝试:)
我想让我的程序读取此XML
Hello
I dont know how to explain what I want but I will try :)
I want to my program to read this XML
<tr>
<td>Oslo</td>
<td>02:29</td><td>03:59</td><td>13:26</td><td>18:03</td><td>22:43</td><td>00:13</td>
</tr>
<tr>
<td>Nordkapp</td>
<td>02:44</td><td>04:14</td><td>13:47</td><td>18:27</td><td>23:10</td><td>00:40</td>
</tr>
好吧..我的程序应该花点时间并写在文本框中
第一行用于奥斯陆,第二行用于Nordkapp(例如:奥斯陆:2:29、3:59、13:26等)
希望您了解我想要的XD
非常抱歉,我的英语不好;)
Well..My program should get the time and write it in textbox
the first line will be for Oslo and the second for Nordkapp(example: Oslo: 2:29, 3:59, 13:26, etc...)
I hope you understand what I want XD
And sorry for my bad English ;)
推荐答案
在此代码中添加一些根标记,您将获得格式正确的XML.假设您用<table>… </table>
包围了它.一旦完成此操作,就可以使用与.NET捆绑在一起的任何XML解析器进行所需的任何操作.
这是我对这些解析器的简短概述:
Add some root tag to this code, and you will get a well-formed XML. Let''s say, you surround it with<table>… </table>
. As soon as you do it, you can do whatever you want with any of the XML parsers bundled with .NET.
Here is my short overview of those parsers:
- 使用
System.Xml.XmlDocument
类.它实现了DOM接口;如果文档太大,则这种方法最简单,也足够好.
请参见- 使用类
].System.Xml.XmlTextReader
; library/system.xml.xmldocument.aspx"target =" _ blank"title =" New Window> ^ - 使用类
- 使用类
System.Xml.XmlTextReader
;这是最快的读取方法,尤其是您需要跳过一些数据.
请参见 http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx [ http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx [http://msdn.microsoft.com/en-us/library/bb387063.aspx [
- Use
System.Xml.XmlDocument
class. It implements DOM interface; this way is the easiest and good enough if the size if the document is not too big.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^]. - Use the class
System.Xml.XmlTextReader
; this is the fastest way of reading, especially is you need to skip some data.
See http://msdn.microsoft.com/en-us/library/system.xml.xmlreader.aspx[^]. - Use the class
System.Xml.Linq.XDocument
; this is the most adequate way similar to that ofXmlDocument
, supporting LINQ to XML Programming.
See http://msdn.microsoft.com/en-us/library/system.xml.xmldocument.aspx[^], http://msdn.microsoft.com/en-us/library/bb387063.aspx[^].
祝你好运,
Good luck,
那不是XML.它是HTML的一部分. XML解析器不适用于您发布的内容,因为XML格式不正确.
That''s not XML. It''s a fragment of HTML. The XML parser will not work with what you''ve posted as it is malformed for XML.
这篇关于XML Visual Basic帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文