• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Set DocumentSource to External File

I have a live XML feed provided to my site and can have it provided in http:// or ftp, I would prefer not to give my FTP details out but cant seem to get it working with http://

        Private Sub Page_Load(ByVal sender As System.Object, _
                      ByVal e As System.EventArgs) Handles MyBase.Load

            'Put user code to initialize the page here
            xmlTransform.DocumentSource = "../xml/Weather.xml"
            xmlTransform.TransformSource = "../xml/weather.xslt"
        End Sub  'Page_Load


That is the code I have that is working but that requires the XML file to be on my Server what I want is

        Private Sub Page_Load(ByVal sender As System.Object, _
                      ByVal e As System.EventArgs) Handles MyBase.Load

            'Put user code to initialize the page here
            xmlTransform.DocumentSource = http://www.thedomain.com/feeds/myxmlfeed.xml"
            xmlTransform.TransformSource = "../xml/weather.xslt"
        End Sub  'Page_Load

I am developing in ASP.Net v 1.1 and it keeps saying http:// is not a virtual path. Having read the documentation on XMLTransform.DocumentSource it seems it does not support external sources, Is this the case or can someone show me a work around.

Thanks in Advance
0
tclgb
Asked:
tclgb
1 Solution
 
b1xml2Commented:
Dim url As String = "http://www.thedomain.com/feeds/myxmlfeed.xml"
Dim reader As New XmlTextReader(url)
Dim document As New XmlDocument()
document.Load(reader)
xmlTransform.Document = document
xmlTransform.TransformSource = "../xml/weather.xslt"
0
 
tclgbAuthor Commented:
b1xml2 that works perfect.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now