473,385 Members | 1,461 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

XML + ASP

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
8 2322
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.