By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,217 Members | 1,818 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,217 IT Pros & Developers. It's quick & easy.

XML + ASP

P: n/a
Hi i'm trying to search a remote website page. The form returns xml
information, though the page extension is missing. I retrieve the
information and write it to the screen. So far so good - However i cannot
format this information in anyway. A copy of the returned information saved
to my server results in the xml data being formatted and displayed as
intended! Can anyone explain to me why one would work but not the other.

Regards

Robert Egan

-- Code Below --

str_HC_url - variable formed from form information

xml.Open "GET", str_HC_url , false - line of code used - does not work

The above brings back info but cannot be formatted using code below.

Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml" ,
false - alternate line of code - does work.
xml.Send
text = xml.ResponseText

If xml.Status = 200 Then
Set oResponseXML = xml.ResponseXML
bXMLLoadError = False
Else
Response.Write("<font color=""red"">Page Error: Could not load XML from
remote server</font><br>")
bXMLLoadError = True
End If

Set xml = nothing

If Not bXMLLoadError Then

// Load XML
set oXML = Server.CreateObject("Microsoft.XMLDOM")
oXML.Async = false
oXML.Load(oResponseXML)

// Load XSL
set oXSL = Server.CreateObject("Microsoft.XMLDOM")
oXSL.Async = False
'oXSL.Load(Server.MapPath("HotCourses.xsl"))
oXSL.Load(Server.MapPath("cdcatalog_ex3.xsl"))
// Transform
'Response.Write(oXML.transformNode(oXSL))

End If
Jul 19 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Response.ContentType = "text/xml"
Response.Write <xml string here>
Response.End

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
Hi i'm trying to search a remote website page. The form returns xml
information, though the page extension is missing. I retrieve the
information and write it to the screen. So far so good - However i cannot
format this information in anyway. A copy of the returned information saved to my server results in the xml data being formatted and displayed as
intended! Can anyone explain to me why one would work but not the other.

Regards

Robert Egan

-- Code Below --

str_HC_url - variable formed from form information

xml.Open "GET", str_HC_url , false - line of code used - does not work

The above brings back info but cannot be formatted using code below.

Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml" ,
false - alternate line of code - does work.
xml.Send
text = xml.ResponseText

If xml.Status = 200 Then
Set oResponseXML = xml.ResponseXML
bXMLLoadError = False
Else
Response.Write("<font color=""red"">Page Error: Could not load XML from remote server</font><br>")
bXMLLoadError = True
End If

Set xml = nothing

If Not bXMLLoadError Then

// Load XML
set oXML = Server.CreateObject("Microsoft.XMLDOM")
oXML.Async = false
oXML.Load(oResponseXML)

// Load XSL
set oXSL = Server.CreateObject("Microsoft.XMLDOM")
oXSL.Async = False
'oXSL.Load(Server.MapPath("HotCourses.xsl"))
oXSL.Load(Server.MapPath("cdcatalog_ex3.xsl"))
// Transform
'Response.Write(oXML.transformNode(oXSL))

End If

Jul 19 '05 #2

P: n/a
Not sure where this should go as the output works fine when using a xml file
saved to my server, but when hitting the same result on a remote it doesn't.
The output is handled by a '.xsl' file, which outputs HTML as follows....

<html>
<body>
<h2>Courses</h2>
<table border="1">
<tr>
<td colspan="9">Search Phrase</td>
</tr>
<tr>
<td colspan="9">Records Returned</td>
</tr>
<tr bgcolor="#9acd32">
<th>CourseId</th>
<th>LDCS</th>
<th>Name</th>
<th>QualificationType</th>
<th>Description</th>
<th>LearnDirectFlag</th>
<th>Venue</th>
<th>AttendanceType</th>
<th>StartDetails</th>
</tr>
<tr>
<td>4988812</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Hendon Campus</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
<tr>
<td>4081296</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Middlesex University</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
.................. etc

</table>
</body>
</html>

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

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Response.ContentType = "text/xml"
Response.Write <xml string here>
Response.End

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
Hi i'm trying to search a remote website page. The form returns xml
information, though the page extension is missing. I retrieve the
information and write it to the screen. So far so good - However i cannot format this information in anyway. A copy of the returned information

saved
to my server results in the xml data being formatted and displayed as
intended! Can anyone explain to me why one would work but not the other.

Regards

Robert Egan

-- Code Below --

str_HC_url - variable formed from form information

xml.Open "GET", str_HC_url , false - line of code used - does not work

The above brings back info but cannot be formatted using code below.

Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml" , false - alternate line of code - does work.
xml.Send
text = xml.ResponseText

If xml.Status = 200 Then
Set oResponseXML = xml.ResponseXML
bXMLLoadError = False
Else
Response.Write("<font color=""red"">Page Error: Could not load XML

from
remote server</font><br>")
bXMLLoadError = True
End If

Set xml = nothing

If Not bXMLLoadError Then

// Load XML
set oXML = Server.CreateObject("Microsoft.XMLDOM")
oXML.Async = false
oXML.Load(oResponseXML)

// Load XSL
set oXSL = Server.CreateObject("Microsoft.XMLDOM")
oXSL.Async = False
'oXSL.Load(Server.MapPath("HotCourses.xsl"))
oXSL.Load(Server.MapPath("cdcatalog_ex3.xsl"))
// Transform
'Response.Write(oXML.transformNode(oXSL))

End If


Jul 19 '05 #3

P: n/a
Robert J Egan wrote:
Hi i'm trying to search a remote website page. The form returns xml
information, though the page extension is missing. I retrieve the
information and write it to the screen. So far so good - However i
cannot format this information in anyway. A copy of the returned
information saved to my server results in the xml data being
formatted and displayed as intended! Can anyone explain to me why one
would work but not the other.

Regards

Robert Egan

-- Code Below --

str_HC_url - variable formed from form information

xml.Open "GET", str_HC_url , false - line of code used - does not work

The above brings back info but cannot be formatted using code below.

Set xml = Server.CreateObject ("Microsoft.XMLHTTP")


Since this is server-side code, you should be using ServerXMLHTTP instead of
XMLHTTP.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #4

P: n/a
Hi Bob have changed Server.CreateObject("Microsoft.XMLHTTP") to

Server.CreateObject("MSXML2.ServerXMLHTTP") ... No error... No records!

Would it be usefull if i posted all code?

Thanks for responding

Rob :)
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OW**************@tk2msftngp13.phx.gbl...
Robert J Egan wrote:
Hi i'm trying to search a remote website page. The form returns xml
information, though the page extension is missing. I retrieve the
information and write it to the screen. So far so good - However i
cannot format this information in anyway. A copy of the returned
information saved to my server results in the xml data being
formatted and displayed as intended! Can anyone explain to me why one
would work but not the other.

Regards

Robert Egan

-- Code Below --

str_HC_url - variable formed from form information

xml.Open "GET", str_HC_url , false - line of code used - does not work

The above brings back info but cannot be formatted using code below.

Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
Since this is server-side code, you should be using ServerXMLHTTP instead

of XMLHTTP.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #5

P: n/a
sorry, missed the part about XSL.

First, make sure that you are getting a valid XML response.
xml.Send
text = xml.ResponseText response.contenttype = "text/xml"
response.write text
response.end

Next make sure that xml.ResponseXML is returning a valid xml document.
According to the MS documentation, if the originator
(http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml) does not set the
response type to "text/xml" then you will get an empty document from
ResponseXML.

If the above is the case use oXML.LoadXML(xml.ResponseText) instead of using
oXML.Load (note: you can load the document directly into the DomDocument
object with the Load method by giving it the URL to the XML file).

Once you are sure that the DomDocument object is loaded ( response.write
oXML.xml) then you can start working on the XSL transformation (if it is not
already known to work properly).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:uV*************@TK2MSFTNGP11.phx.gbl...
Not sure where this should go as the output works fine when using a xml file saved to my server, but when hitting the same result on a remote it doesn't. The output is handled by a '.xsl' file, which outputs HTML as follows....

<html>
<body>
<h2>Courses</h2>
<table border="1">
<tr>
<td colspan="9">Search Phrase</td>
</tr>
<tr>
<td colspan="9">Records Returned</td>
</tr>
<tr bgcolor="#9acd32">
<th>CourseId</th>
<th>LDCS</th>
<th>Name</th>
<th>QualificationType</th>
<th>Description</th>
<th>LearnDirectFlag</th>
<th>Venue</th>
<th>AttendanceType</th>
<th>StartDetails</th>
</tr>
<tr>
<td>4988812</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Hendon Campus</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
<tr>
<td>4081296</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Middlesex University</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
................. etc

</table>
</body>
</html>

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

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Response.ContentType = "text/xml"
Response.Write <xml string here>
Response.End

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
Hi i'm trying to search a remote website page. The form returns xml
information, though the page extension is missing. I retrieve the
information and write it to the screen. So far so good - However i cannot format this information in anyway. A copy of the returned information saved
to my server results in the xml data being formatted and displayed as
intended! Can anyone explain to me why one would work but not the
other.
Regards

Robert Egan

-- Code Below --

str_HC_url - variable formed from form information

xml.Open "GET", str_HC_url , false - line of code used - does not work

The above brings back info but cannot be formatted using code below.

Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
xml.Open "GET",

"http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml" , false - alternate line of code - does work.
xml.Send
text = xml.ResponseText

If xml.Status = 200 Then
Set oResponseXML = xml.ResponseXML
bXMLLoadError = False
Else
Response.Write("<font color=""red"">Page Error: Could not load XML

from
remote server</font><br>")
bXMLLoadError = True
End If

Set xml = nothing

If Not bXMLLoadError Then

// Load XML
set oXML = Server.CreateObject("Microsoft.XMLDOM")
oXML.Async = false
oXML.Load(oResponseXML)

// Load XSL
set oXSL = Server.CreateObject("Microsoft.XMLDOM")
oXSL.Async = False
'oXSL.Load(Server.MapPath("HotCourses.xsl"))
oXSL.Load(Server.MapPath("cdcatalog_ex3.xsl"))
// Transform
'Response.Write(oXML.transformNode(oXSL))

End If



Jul 19 '05 #6

P: n/a
Mark,

Many thanks for your help

You've helped my understanding of this new subject for me. The search now
works using the remote page. I hadn't followed the specification 100%. There
was a space in the postcode! - Doh

My Search - http://www.accessburnley.co.uk/xml/asp/hotcourses.asp
The Remote Server -
http://213.219.10.130/pls/cgi-bin-ch...earningType=17,
18&GetXRecords=5000&PhraseSearch=French

In my xsl file that transforms the results i loop through the records but
cannot not retrieve the number of results found or the search phrase used -
why?. Also do you see me being able to page through these results? If so any
ideas how?

Regards

Rob

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Courses</h2>
<table border="1">
<tr>
<td colspan="9">Search Phrase<xsl:value-of select="PhraseSearch" /></td>
</tr>
<tr>
<td colspan="9">Records Returned<xsl:value-of select="RecordsReturned"
/></td>
</tr>
<tr bgcolor="#9acd32">
<th>CourseId</th>
<th>LDCS</th>
<th>Name</th>
<th>QualificationType</th>
<th>Description</th>
<th>LearnDirectFlag</th>
<th>Venue</th>
<th>AttendanceType</th>
<th>StartDetails</th>
</tr>
<xsl:for-each select="learndirect-list/Record">
<xsl:sort select="Name"/>
<tr>
<td><xsl:value-of select="CourseId" /></td>
<td><xsl:value-of select="LDCS" /></td>
<td><xsl:value-of select="Name" /></td>
<td><xsl:value-of select="QualificationType" /></td>
<td><xsl:value-of select="Description" /></td>
<td><xsl:value-of select="LearnDirectFlag" /></td>
<td><xsl:value-of select="Venue" /></td>
<td><xsl:value-of select="AttendanceType" /></td>
<td><xsl:value-of select="StartDetails" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:uq******************@TK2MSFTNGP10.phx.gbl...
sorry, missed the part about XSL.

First, make sure that you are getting a valid XML response.
> xml.Send
> text = xml.ResponseText response.contenttype = "text/xml"
response.write text
response.end

Next make sure that xml.ResponseXML is returning a valid xml document.
According to the MS documentation, if the originator
(http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml) does not set the
response type to "text/xml" then you will get an empty document from
ResponseXML.

If the above is the case use oXML.LoadXML(xml.ResponseText) instead of using oXML.Load (note: you can load the document directly into the DomDocument
object with the Load method by giving it the URL to the XML file).

Once you are sure that the DomDocument object is loaded ( response.write
oXML.xml) then you can start working on the XSL transformation (if it is not already known to work properly).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:uV*************@TK2MSFTNGP11.phx.gbl...
Not sure where this should go as the output works fine when using a xml

file
saved to my server, but when hitting the same result on a remote it

doesn't.
The output is handled by a '.xsl' file, which outputs HTML as follows....
<html>
<body>
<h2>Courses</h2>
<table border="1">
<tr>
<td colspan="9">Search Phrase</td>
</tr>
<tr>
<td colspan="9">Records Returned</td>
</tr>
<tr bgcolor="#9acd32">
<th>CourseId</th>
<th>LDCS</th>
<th>Name</th>
<th>QualificationType</th>
<th>Description</th>
<th>LearnDirectFlag</th>
<th>Venue</th>
<th>AttendanceType</th>
<th>StartDetails</th>
</tr>
<tr>
<td>4988812</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Hendon Campus</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
<tr>
<td>4081296</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Middlesex University</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
................. etc

</table>
</body>
</html>

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

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Response.ContentType = "text/xml"
Response.Write <xml string here>
Response.End

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...
> Hi i'm trying to search a remote website page. The form returns xml
> information, though the page extension is missing. I retrieve the
> information and write it to the screen. So far so good - However i

cannot
> format this information in anyway. A copy of the returned information saved
> to my server results in the xml data being formatted and displayed as > intended! Can anyone explain to me why one would work but not the

other. >
> Regards
>
> Robert Egan
>
> -- Code Below --
>
> str_HC_url - variable formed from form information
>
> xml.Open "GET", str_HC_url , false - line of code used - does not work >
> The above brings back info but cannot be formatted using code below.
>
> Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
> xml.Open "GET",

"http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml"
,
> false - alternate line of code - does work.
> xml.Send
> text = xml.ResponseText
>
> If xml.Status = 200 Then
> Set oResponseXML = xml.ResponseXML
> bXMLLoadError = False
> Else
> Response.Write("<font color=""red"">Page Error: Could not load XML from
> remote server</font><br>")
> bXMLLoadError = True
> End If
>
> Set xml = nothing
>
> If Not bXMLLoadError Then
>
> // Load XML
> set oXML = Server.CreateObject("Microsoft.XMLDOM")
> oXML.Async = false
> oXML.Load(oResponseXML)
>
> // Load XSL
> set oXSL = Server.CreateObject("Microsoft.XMLDOM")
> oXSL.Async = False
> 'oXSL.Load(Server.MapPath("HotCourses.xsl"))
> oXSL.Load(Server.MapPath("cdcatalog_ex3.xsl"))
> // Transform
> 'Response.Write(oXML.transformNode(oXSL))
>
> End If
>
>



Jul 19 '05 #7

P: n/a
Mark have managed to get the search phrase, and number of records back -
just didn't know the syntax! If you can shed some light on the paging of the
results then that would be great! Not sure where to do it or how.

rob
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
Mark,

Many thanks for your help

You've helped my understanding of this new subject for me. The search now
works using the remote page. I hadn't followed the specification 100%. There was a space in the postcode! - Doh

My Search - http://www.accessburnley.co.uk/xml/asp/hotcourses.asp
The Remote Server -
http://213.219.10.130/pls/cgi-bin-ch...earningType=17, 18&GetXRecords=5000&PhraseSearch=French

In my xsl file that transforms the results i loop through the records but
cannot not retrieve the number of results found or the search phrase used - why?. Also do you see me being able to page through these results? If so any ideas how?

Regards

Rob

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Courses</h2>
<table border="1">
<tr>
<td colspan="9">Search Phrase<xsl:value-of select="PhraseSearch" /></td> </tr>
<tr>
<td colspan="9">Records Returned<xsl:value-of select="RecordsReturned"
/></td>
</tr>
<tr bgcolor="#9acd32">
<th>CourseId</th>
<th>LDCS</th>
<th>Name</th>
<th>QualificationType</th>
<th>Description</th>
<th>LearnDirectFlag</th>
<th>Venue</th>
<th>AttendanceType</th>
<th>StartDetails</th>
</tr>
<xsl:for-each select="learndirect-list/Record">
<xsl:sort select="Name"/>
<tr>
<td><xsl:value-of select="CourseId" /></td>
<td><xsl:value-of select="LDCS" /></td>
<td><xsl:value-of select="Name" /></td>
<td><xsl:value-of select="QualificationType" /></td>
<td><xsl:value-of select="Description" /></td>
<td><xsl:value-of select="LearnDirectFlag" /></td>
<td><xsl:value-of select="Venue" /></td>
<td><xsl:value-of select="AttendanceType" /></td>
<td><xsl:value-of select="StartDetails" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:uq******************@TK2MSFTNGP10.phx.gbl...
sorry, missed the part about XSL.

First, make sure that you are getting a valid XML response.
> > xml.Send
> > text = xml.ResponseText

response.contenttype = "text/xml"
response.write text
response.end

Next make sure that xml.ResponseXML is returning a valid xml document.
According to the MS documentation, if the originator
(http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml) does not set the
response type to "text/xml" then you will get an empty document from
ResponseXML.

If the above is the case use oXML.LoadXML(xml.ResponseText) instead of

using
oXML.Load (note: you can load the document directly into the DomDocument
object with the Load method by giving it the URL to the XML file).

Once you are sure that the DomDocument object is loaded ( response.write
oXML.xml) then you can start working on the XSL transformation (if it is

not
already known to work properly).

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:uV*************@TK2MSFTNGP11.phx.gbl...
Not sure where this should go as the output works fine when using a xml
file
saved to my server, but when hitting the same result on a remote it

doesn't.
The output is handled by a '.xsl' file, which outputs HTML as follows....
<html>
<body>
<h2>Courses</h2>
<table border="1">
<tr>
<td colspan="9">Search Phrase</td>
</tr>
<tr>
<td colspan="9">Records Returned</td>
</tr>
<tr bgcolor="#9acd32">
<th>CourseId</th>
<th>LDCS</th>
<th>Name</th>
<th>QualificationType</th>
<th>Description</th>
<th>LearnDirectFlag</th>
<th>Venue</th>
<th>AttendanceType</th>
<th>StartDetails</th>
</tr>
<tr>
<td>4988812</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Hendon Campus</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
<tr>
<td>4081296</td>
<td>AK.6,FN.343</td>
<td>Accounting with French BA (Hons)</td>
<td>First Degree</td>
<td>3 year full time/ up to 8 years part time course run by Middlesex
University</td>
<td>TC</td>
<td>Middlesex University</td>
<td>Full Time</td>
<td>Sep/04</td>
</tr>
................. etc

</table>
</body>
</html>

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

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> Response.ContentType = "text/xml"
> Response.Write <xml string here>
> Response.End
>
> --
> Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
>
> "Robert J Egan" <ro********@hotmail.com> wrote in message
> news:O6**************@TK2MSFTNGP09.phx.gbl...
> > Hi i'm trying to search a remote website page. The form returns
xml > > information, though the page extension is missing. I retrieve the
> > information and write it to the screen. So far so good - However i
cannot
> > format this information in anyway. A copy of the returned

information > saved
> > to my server results in the xml data being formatted and displayed as > > intended! Can anyone explain to me why one would work but not the

other.
> >
> > Regards
> >
> > Robert Egan
> >
> > -- Code Below --
> >
> > str_HC_url - variable formed from form information
> >
> > xml.Open "GET", str_HC_url , false - line of code used - does not work > >
> > The above brings back info but cannot be formatted using code below. > >
> > Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
> > xml.Open "GET",

"http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml"
,
> > false - alternate line of code - does work.
> > xml.Send
> > text = xml.ResponseText
> >
> > If xml.Status = 200 Then
> > Set oResponseXML = xml.ResponseXML
> > bXMLLoadError = False
> > Else
> > Response.Write("<font color=""red"">Page Error: Could not load XML > from
> > remote server</font><br>")
> > bXMLLoadError = True
> > End If
> >
> > Set xml = nothing
> >
> > If Not bXMLLoadError Then
> >
> > // Load XML
> > set oXML = Server.CreateObject("Microsoft.XMLDOM")
> > oXML.Async = false
> > oXML.Load(oResponseXML)
> >
> > // Load XSL
> > set oXSL = Server.CreateObject("Microsoft.XMLDOM")
> > oXSL.Async = False
> > 'oXSL.Load(Server.MapPath("HotCourses.xsl"))
> > oXSL.Load(Server.MapPath("cdcatalog_ex3.xsl"))
> > // Transform
> > 'Response.Write(oXML.transformNode(oXSL))
> >
> > End If
> >
> >
>
>



Jul 19 '05 #8

P: n/a
Thanks for your advise Mark. I'm looking in to using the JavaScript approach
you mentioned.

Cheers

Rob :)
"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:Oa**************@tk2msftngp13.phx.gbl...
Paging would best be done in the query itself. If it does not support paging (look through www.aspfaq.com for examples of some common techniques) and you are including all results in the XML file then you might consider using
JavaScript on the client to display one page of results at a time. Put the
results in a JavaScript array and redraw the table with the current page's
data.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:eN**************@TK2MSFTNGP12.phx.gbl...
Mark have managed to get the search phrase, and number of records back -
just didn't know the syntax! If you can shed some light on the paging of the
results then that would be great! Not sure where to do it or how.

rob
"Robert J Egan" <ro********@hotmail.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
Mark,

Many thanks for your help

You've helped my understanding of this new subject for me. The search now works using the remote page. I hadn't followed the specification 100%.

There
was a space in the postcode! - Doh

My Search - http://www.accessburnley.co.uk/xml/asp/hotcourses.asp
The Remote Server -

http://213.219.10.130/pls/cgi-bin-ch...earningType=17,
18&GetXRecords=5000&PhraseSearch=French

In my xsl file that transforms the results i loop through the records but cannot not retrieve the number of results found or the search phrase

used -
why?. Also do you see me being able to page through these results? If so
any
ideas how?

Regards

Rob

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Courses</h2>
<table border="1">
<tr>
<td colspan="9">Search Phrase<xsl:value-of select="PhraseSearch"

/></td>
</tr>
<tr>
<td colspan="9">Records Returned<xsl:value-of select="RecordsReturned" /></td>
</tr>
<tr bgcolor="#9acd32">
<th>CourseId</th>
<th>LDCS</th>
<th>Name</th>
<th>QualificationType</th>
<th>Description</th>
<th>LearnDirectFlag</th>
<th>Venue</th>
<th>AttendanceType</th>
<th>StartDetails</th>
</tr>
<xsl:for-each select="learndirect-list/Record">
<xsl:sort select="Name"/>
<tr>
<td><xsl:value-of select="CourseId" /></td>
<td><xsl:value-of select="LDCS" /></td>
<td><xsl:value-of select="Name" /></td>
<td><xsl:value-of select="QualificationType" /></td>
<td><xsl:value-of select="Description" /></td>
<td><xsl:value-of select="LearnDirectFlag" /></td>
<td><xsl:value-of select="Venue" /></td>
<td><xsl:value-of select="AttendanceType" /></td>
<td><xsl:value-of select="StartDetails" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:uq******************@TK2MSFTNGP10.phx.gbl...
> sorry, missed the part about XSL.
>
> First, make sure that you are getting a valid XML response.
>
> > > > xml.Send
> > > > text = xml.ResponseText
> response.contenttype = "text/xml"
> response.write text
> response.end
>
> Next make sure that xml.ResponseXML is returning a valid xml
document. > According to the MS documentation, if the originator
> (http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml) does not set the > response type to "text/xml" then you will get an empty document from
> ResponseXML.
>
> If the above is the case use oXML.LoadXML(xml.ResponseText) instead of using
> oXML.Load (note: you can load the document directly into the DomDocument > object with the Load method by giving it the URL to the XML file).
>
> Once you are sure that the DomDocument object is loaded ( response.write > oXML.xml) then you can start working on the XSL transformation (if it is
not
> already known to work properly).
>
> --
> Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
>
> "Robert J Egan" <ro********@hotmail.com> wrote in message
> news:uV*************@TK2MSFTNGP11.phx.gbl...
> > Not sure where this should go as the output works fine when using
a xml
> file
> > saved to my server, but when hitting the same result on a remote
it > doesn't.
> > The output is handled by a '.xsl' file, which outputs HTML as
follows....
> >
> > <html>
> > <body>
> > <h2>Courses</h2>
> > <table border="1">
> > <tr>
> > <td colspan="9">Search Phrase</td>
> > </tr>
> > <tr>
> > <td colspan="9">Records Returned</td>
> > </tr>
> > <tr bgcolor="#9acd32">
> > <th>CourseId</th>
> > <th>LDCS</th>
> > <th>Name</th>
> > <th>QualificationType</th>
> > <th>Description</th>
> > <th>LearnDirectFlag</th>
> > <th>Venue</th>
> > <th>AttendanceType</th>
> > <th>StartDetails</th>
> > </tr>
> > <tr>
> > <td>4988812</td>
> > <td>AK.6,FN.343</td>
> > <td>Accounting with French BA (Hons)</td>
> > <td>First Degree</td>
> > <td>3 year full time/ up to 8 years part time course run by
Middlesex > > University</td>
> > <td>TC</td>
> > <td>Hendon Campus</td>
> > <td>Full Time</td>
> > <td>Sep/04</td>
> > </tr>
> > <tr>
> > <td>4081296</td>
> > <td>AK.6,FN.343</td>
> > <td>Accounting with French BA (Hons)</td>
> > <td>First Degree</td>
> > <td>3 year full time/ up to 8 years part time course run by Middlesex > > University</td>
> > <td>TC</td>
> > <td>Middlesex University</td>
> > <td>Full Time</td>
> > <td>Sep/04</td>
> > </tr>
> > ................. etc
> >
> > </table>
> > </body>
> > </html>
> >
> > -------------
> >
> > "Mark Schupp" <ms*****@ielearning.com> wrote in message
> > news:%2****************@TK2MSFTNGP09.phx.gbl...
> > > Response.ContentType = "text/xml"
> > > Response.Write <xml string here>
> > > Response.End
> > >
> > > --
> > > Mark Schupp
> > > Head of Development
> > > Integrity eLearning
> > > www.ielearning.com
> > >
> > >
> > > "Robert J Egan" <ro********@hotmail.com> wrote in message
> > > news:O6**************@TK2MSFTNGP09.phx.gbl...
> > > > Hi i'm trying to search a remote website page. The form
returns xml
> > > > information, though the page extension is missing. I retrieve

the > > > > information and write it to the screen. So far so good -
However i > > cannot
> > > > format this information in anyway. A copy of the returned
information
> > > saved
> > > > to my server results in the xml data being formatted and displayed as
> > > > intended! Can anyone explain to me why one would work but not the > other.
> > > >
> > > > Regards
> > > >
> > > > Robert Egan
> > > >
> > > > -- Code Below --
> > > >
> > > > str_HC_url - variable formed from form information
> > > >
> > > > xml.Open "GET", str_HC_url , false - line of code used - does not work
> > > >
> > > > The above brings back info but cannot be formatted using code

below.
> > > >
> > > > Set xml = Server.CreateObject ("Microsoft.XMLHTTP")
> > > > xml.Open "GET",
> "http://www.accessburnley.co.uk/xml/asp/cdcatalog.xml"
> > ,
> > > > false - alternate line of code - does work.
> > > > xml.Send
> > > > text = xml.ResponseText
> > > >
> > > > If xml.Status = 200 Then
> > > > Set oResponseXML = xml.ResponseXML
> > > > bXMLLoadError = False
> > > > Else
> > > > Response.Write("<font color=""red"">Page Error: Could not load XML
> > > from
> > > > remote server</font><br>")
> > > > bXMLLoadError = True
> > > > End If
> > > >
> > > > Set xml = nothing
> > > >
> > > > If Not bXMLLoadError Then
> > > >
> > > > // Load XML
> > > > set oXML = Server.CreateObject("Microsoft.XMLDOM")
> > > > oXML.Async = false
> > > > oXML.Load(oResponseXML)
> > > >
> > > > // Load XSL
> > > > set oXSL = Server.CreateObject("Microsoft.XMLDOM")
> > > > oXSL.Async = False
> > > > 'oXSL.Load(Server.MapPath("HotCourses.xsl"))
> > > > oXSL.Load(Server.MapPath("cdcatalog_ex3.xsl"))
> > > > // Transform
> > > > 'Response.Write(oXML.transformNode(oXSL))
> > > >
> > > > End If
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 19 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.