S
Simon Harris
Hi All,
Ok, this must be a simple one, I'm trying to read a certain elements
contents from an XML file. Heres what I've come up with so far, which
seems
to get stuick in a loop (ASPNET.EXE hogs the CPU until I kill it!)
Public Function GetPageName(ByVal XMLFileName As String) As String
Dim XmlReader As New
XmlTextReader(Session("DataLocation").ToString
& XMLFileName)
XmlReader.Read()
While Not XmlReader.EOF
If XmlReader.Name = "Title" Then
Return XmlReader.ReadString()
End If
End While
'Return XmlReader.ReadElementString("Title")
XmlReader.Close()
End Function
Note that session("datalocation") is a full path.
Thanks,
Simon.
Ok, this must be a simple one, I'm trying to read a certain elements
contents from an XML file. Heres what I've come up with so far, which
seems
to get stuick in a loop (ASPNET.EXE hogs the CPU until I kill it!)
Public Function GetPageName(ByVal XMLFileName As String) As String
Dim XmlReader As New
XmlTextReader(Session("DataLocation").ToString
& XMLFileName)
XmlReader.Read()
While Not XmlReader.EOF
If XmlReader.Name = "Title" Then
Return XmlReader.ReadString()
End If
End While
'Return XmlReader.ReadElementString("Title")
XmlReader.Close()
End Function
Note that session("datalocation") is a full path.
Thanks,
Simon.