coastalrocket@yahoo.co.uk (Andy B) wrote in message news:<f1523bf.0502051007.10a6f0be@posting.google.com>...
> Hi Derek,
> I tried the code you posted but get an error of 'URI formats are not
> supported.' when i declare
> > > Dim reader As GeoReplacementXmlTextReader = _
> > > New GeoReplacementXmlTextReader( _
> > > New System.IO.StreamReader( URLString) )
> It looks like a system.io.streamreader doesn't accept a URL string.
> I'll try sorting this out but i thought i'd post back quickly with the
> error in case anyone knows immediately the solution here.
>
> "digger440uk" <coastalrocket@yahoo.co.uk> wrote in message news:<1107204051.970243.31580@c13g2000cwb.googlegroups.com>...
> > Cheers Derek. That is fantastic what you've posted. i'll try it out on
> > my commute tomorrow. since i'm clueless over the namespace question i
> > might be back here quite quickly.
> >
> > But thanks again, its replies like this which blow me away sometimes.
> > Andy
> >
> > Derek Harmon wrote:
> > > "Andy B" <coastalrocket@yahoo.co.uk> wrote in message
> > news:f1523bf.0501300502.46146cf5@posting.google.com...
> > > > columns but i don't know of a way to treat the xml as a string,
> > change
> > > > the column names and then feed the results to an xmltextreader.
> > >
> > > Instead of XmlTextReader, you can subclass XmlTextReader
> > > and use that to read-in the XML document and perform the
> > > replacements while the XML comes streaming in. Here's an
> > > example of such a subclass.
> > >
> > > - - - GRXmlTextReader.vb
> > > Imports System
> > > Imports System.IO
> > > Imports System.Xml
> > >
> > > Public Class GeoReplacementXmlTextReader
> > > Inherits XmlTextReader
> > >
> > > Public Sub New( ByVal source As TextReader)
> > > MyBase.New( source)
> > > End Sub
> > >
> > > Public Overrides ReadOnly Property Prefix( ) As String
> > > Get
> > > Dim _prefix As String = MyBase.Prefix
> > > If (_prefix = "geo") Then
> > > Dim localName As String = MyBase.LocalName
> > > If (localName = "lat") Then
> > > Return ""
> > > Else If (localName = "long") Then
> > > Return ""
> > > End If
> > > End If
> > > Return _prefix
> > > End Get
> > > End Property
> > >
> > > Public Overrides ReadOnly Property LocalName( ) As String
> > > Get
> > > Dim prefix As String = MyBase.Prefix
> > > Dim _localName As String = MyBase.LocalName
> > > If (prefix = "geo") Then
> > > If (_localName = "lat") Then
> > > Return "latitude"
> > > Else If (_localName = "long") Then
> > > Return "longitude"
> > > End If
> > > End If
> > > Return _localName
> > > End Get
> > > End Property
> > >
> > > Public Overrides ReadOnly Property NamespaceURI( ) As String
> > > Get
> > > Dim nsURI As String = MyBase.NamespaceURI
> > > If (nsURI = "
http://www.w3.org/2003/01/geo/wgs84_pos#")
> > Then
> > > Dim localName As String = MyBase.LocalName
> > > If (localName = "lat") Then
> > > Return ""
> > > Else If (localName = "long") Then
> > > Return ""
> > > End If
> > > End If
> > > Return nsURI
> > > End Get
> > > End Property
> > >
> > > End Class
> > > - - -
> > >
> > > > ' We need to replace geo:lat with latitude and
> > > > ' geo:long with longitude
> > > > Dim reader As XmlTextReader = New XmlTextReader(URLString)
> > >
> > > Then the one-line replacement,
> > >
> > > Dim reader As GeoReplacementXmlTextReader = _
> > > New GeoReplacementXmlTextReader( _
> > > New System.IO.StreamReader( URLString) )
> > >
> > > You're also planning to replace the
> > "
http://purl.org/dc/elements/1.1/"
> > > namespace URI prefix, right?
> > >
> > >
> > > Derek Harmon
Function GetHtmlPageSource(ByVal url As String, Optional ByVal username As _
String = Nothing, Optional ByVal password As String = Nothing) As String
Dim req As System.Net.WebRequest = System.Net.WebRequest.Create(url)