A
Arvind P Rangan
Hi,
Code:
Dim xmlstring As String = "http://localhost/log.xml"
Dim xmlreads As XmlTextReader = New XmlTextReader(xmlstring)
Dim id As Integer = 0
Try
While xmlreads.Read()
Select Case xmlreads.NodeType
Case XmlNodeType.Element
If InStr(xmlreads.Name, "id") > 0 Then
Response.Write(" " + xmlreads.Name + "='" +
xmlreads.Value + "'")
End If
End Select
End While
'Response.Write(id.ToString)
Catch es As Exception
If Not InStr(es.Message, "404") = 0 Then
Response.Write("File Not Found!!!!" & InStr(es.Message,
"404"))
Else
Response.Write(InStr(es.Message, "404") & es.Message)
End If
End Try
XMLFILE:
<?xml version="1.0" encoding="utf-8" ?>
<LOG xmlns="log.xsd">
<id>1</logid>
<logdatetime>2002-05-30T09:00:00</logdatetime>
<eventtitle>New</eventtitle>
<eventdesc>adsadsadsad </eventdesc>
<eventby>arangan</eventby>
<id>1</logid>
<logdatetime>2002-05-30T09:00:00</logdatetime>
<eventtitle>New</eventtitle>
<eventdesc>adsadsadsad </eventdesc>
<eventby>arangan</eventby>
</LOG>
ERROR: id='' id='' ???? why am i not getting the values ????
Pls Help me
Thanks
Arvind
Code:
Dim xmlstring As String = "http://localhost/log.xml"
Dim xmlreads As XmlTextReader = New XmlTextReader(xmlstring)
Dim id As Integer = 0
Try
While xmlreads.Read()
Select Case xmlreads.NodeType
Case XmlNodeType.Element
If InStr(xmlreads.Name, "id") > 0 Then
Response.Write(" " + xmlreads.Name + "='" +
xmlreads.Value + "'")
End If
End Select
End While
'Response.Write(id.ToString)
Catch es As Exception
If Not InStr(es.Message, "404") = 0 Then
Response.Write("File Not Found!!!!" & InStr(es.Message,
"404"))
Else
Response.Write(InStr(es.Message, "404") & es.Message)
End If
End Try
XMLFILE:
<?xml version="1.0" encoding="utf-8" ?>
<LOG xmlns="log.xsd">
<id>1</logid>
<logdatetime>2002-05-30T09:00:00</logdatetime>
<eventtitle>New</eventtitle>
<eventdesc>adsadsadsad </eventdesc>
<eventby>arangan</eventby>
<id>1</logid>
<logdatetime>2002-05-30T09:00:00</logdatetime>
<eventtitle>New</eventtitle>
<eventdesc>adsadsadsad </eventdesc>
<eventby>arangan</eventby>
</LOG>
ERROR: id='' id='' ???? why am i not getting the values ????
Pls Help me
Thanks
Arvind