首先,我将链接我的相当大的xml文档的开头,然后链接我用来读取xml文档的代码;编译时抛出以下异常。 “根级别的数据无效。第1行,第1位”
<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
<!--
created utilizing kigkonsult.se iCalcreator 2.16.12 iCal2XMl (rfc6321)
-->
<vcalendar>
<properties>
<prodid>
<text>
-//opendata.unm.edu//NONSGML kigkonsult.se iCalcreator 2.16.12//
</text>
</prodid>
<version>
<text>2.0</text>
</version>
<method>
<text>PUBLISH</text>
</method>
</properties>
<components>
<vevent>
<properties>
<uid>
<text>caf72d80-edec-4175-96d8-802a68fa186f</text>
</uid>
<dtstamp>
<date-time>2013-10-17T20:45:00Z</date-time>
</dtstamp>
<summary>
<text>UFO Speaker Stanton Friedman</text>
</summary>
<description>
我的Visual Basic 2010 Express for Phone Code:
Public Sub LoadData()
Try
Dim filePathUnm As String = "http://datastore.unm.edu/events/events.xml"
Dim rs As XmlReaderSettings = New XmlReaderSettings()
rs.DtdProcessing = DtdProcessing.Parse
rs.IgnoreWhitespace = True
Dim unmEventXml As XmlReader = XmlReader.Create(New StringReader(filePathUnm), rs)
While unmEventXml.Read()
Select Case unmEventXml.NodeType
End Select
End While
Me.IsDataLoaded = True
Catch ex As XmlException
MessageBox.Show(ex.Message)
End Try
End Sub
非常感谢!这个xml代码来自公共存储库,所以我需要能够读取它。这也是存储库的顶部。 “这个XML文件似乎没有与之关联的任何样式信息。文档树如下所示。”以下是存储库的链接:http://datastore.unm.edu/events/events.xml