Help accessing an XML document from a URL

Help accessing an XML document from a URL

am 23.01.2007 15:36:31 von TheDude5B

Hi, I have the following code which accesses an XML document and then
displays the document using XSL.
------------------------------------------------------------ -----------------------------------------------------------
Dim xmlDocument
Dim xslDocument
Dim path
Dim XSLTemplate
Dim proc
Dim nodes

set xmlDocument=CreateObject("MSXML2.FreeThreadedDOMDocument")
xmlDocument.async="false"
xmlDocument.load(Server.MapPath("test.xml"))
path="/forum"
set nodes = xmlDocument.selectNodes(path)

If nodes.length = 0 Then

Response.Redirect("noMatch.asp")

Else

set xslDocument=CreateObject("MSXML2.FreeThreadedDOMDocument")
xslDocument.async="false"
xslDocument.load(Server.MapPath("gigs.xsl"))
Set XSLTemplate =Server.CreateObject("MSXML2.XSLTemplate")
Set XSLTemplate.stylesheet = xslDocument
Set proc=XSLTemplate.createProcessor()

proc.input = xmlDocument
proc.Transform

Response.Write proc.output

End If
------------------------------------------------------------ ------------------------------------------------------------ ------------

The code works fine when I am loading the XML document from the local
server, but when I change the code to:

xmlDocument.Load("http://myurl.com/db/test.xml")

I seem to have problems. The browser seems to get stuck loading and
never returns any value, not even an error message.

Is this the correct way to load an XML document from a URL? Is there
some sort of server setting which may be blocking my code from access
this XML document?

.............................

Another Question.
.............................

Once I have solved this problem, I have another problem. The XML
document is not formed in a familiar way that I am used to, so I am
unsure of how to display it via XSL. The XML document looks like this.

------------------------------------------------------------ -------------------------------------------




London KOKO

1A Camden High Street, NW1

http://www.koko.uk.com
January 19th - The On/Offs
January 26th - The Envy Corps & Low Vs Diamond



Aberdeen Moshulu
Windmill Brae, Aberdeen, AB11 6HU


January 30th - Pop Levi
February 6th - Ratatat & the Whip



Birmingham Custard Factory
Gibb Square, Birmingham, B9 4AA


January 25th - The Violets
February 1st - Ratatat



------------------------------------------------------------ ----------------------------------------------------

I want to be able to display each part as City, Venue, Address, URL,
and then the gigs. But because the City is not within a tag and
is just displayed as , how would I access this data in XSL ?

Sorry for the long questiong, but I really need help with this now.

Thanks

Re: Help accessing an XML document from a URL

am 23.01.2007 16:53:32 von Anthony Jones

"TheDude5B" wrote in message
news:1169562991.103634.257870@d71g2000cwa.googlegroups.com.. .
> Hi, I have the following code which accesses an XML document and then
> displays the document using XSL.
> ------------------------------------------------------------ --------------
---------------------------------------------
> Dim xmlDocument
> Dim xslDocument
> Dim path
> Dim XSLTemplate
> Dim proc
> Dim nodes
>



You've asked this question also in the XML group where it has been answered
please don't multipost. If you are unsure which group to post to use a
cross post.