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 8 2226
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
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
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.
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.
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
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 > >
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 > > > > > >
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 > > > > > > > > > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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....
|
by: concettolabs |
last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
| |