the xml part i have fixed, there was chinese text in the db ---------- Original Message ---------------------------------- From: "Gavin Brook" <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] Date: Thu, 28 Oct 2004 14:43:36 +0100
>Have you got any sample data? The "lt" makes me think "less than" symbol, >maybe there is something in your data that is causing invalid XML?? > >Gav > >-----Original Message----- >From: dave [mailto:[EMAIL PROTECTED] >Sent: 28 October 2004 10:11 >To: CF-Talk >Subject: asp 2 cfm help pleazzzzzzzzzzzz > > >working on converting this page >here is the asp code, mostly interested in the paging part > ><%@ Language=VBScript %> ><% Response.Buffer=True %> ><% >Dim GuestBookName >dim GuestbookUrl >Dim MailBox >Dim Password1 >Dim AllowUbbcode >Dim ConnectionString >Dim PageSize >Dim AdminLogFlag > >IF Session("AdminLogged")<>1 THEN > AdminLogFlag=0 >ELSE > AdminLogFlag=1 >END IF > >'default Ado Connection Object >dim conn >'default ado recordset object >dim rs > >PageSize=15 >GuestBookName=" BlueIdea.com " >AllowUbbCode=False >ConnectionString="Driver=Microsoft Access Driver (*.mdb);dbq=" & >Server.MapPath("Database/GuestBook.mdb") > >Dim i >Dim intPageCount >Dim intRecordCount >Dim page >if isempty(Request("Page")) then > Page=1 >else > if isnumeric(request("page")) then > on error resume next > Page=clng(abs(Request("Page"))) > if err.number<>0 then > Page=1 > err.clear > end if > on error goto 0 > else > Page=1 > end if >end if > >Response.ContentType = "text/xml" >Response.Expires = -1 >Response.Write "<?xml version='1.0' encoding='GB2312'?>" Response.Write >"<threads " > >Set con=Server.CreateObject("ADODB.Connection") > con.Open ConnectionString >Set rs=Server.CreateObject("ADODB.RecordSet") > rs.Open "select * from GuestBook order by postdatetime desc",con,3 > > intRecordCount=rs.RecordCount > if not (rs.EOF and rs.BOF) then > rs.PageSize=PageSize > intPageCount=rs.PageCount > if page>intPageCount then > page=intPageCount > end if > rs.AbsolutePage=Page > > Response.Write "PageCount="""&intPageCount&""" >RecordCount="""&intRecordCount&""" AdminLog="""&AdminLogFlag&""">" > > for i=1 to pagesize > if rs.EOF then > exit for > end if > Response.Write "<message>" > > Response.Write "<subject>" > Response.Write rs("subject") > Response.Write "</subject>" > > Response.Write "<number>" > Response.Write rs("number") > Response.Write "</number>" > > Response.Write "<email>" > Response.Write rs("email") > Response.Write "</email>" > > Response.Write "<url>" > Response.Write rs("url") > Response.Write "</url>" > > Response.Write "<body><![CDATA[" > Response.Write rs("message") > Response.Write "]]></body>" > > Response.Write "<sex>" > Response.Write rs("sex") > Response.Write "</sex>" > > Response.Write "<reply><![CDATA[" > Response.Write rs("reply") > Response.Write "]]></reply>" > > Response.Write "<icon>" > Response.Write rs("icon") > Response.Write "</icon>" > > Response.Write "<posted>" > Response.Write rs("postdatetime") > Response.Write "</posted>" > > Response.Write "<face>" > Response.Write rs("face") > Response.Write "</face>" > > Response.Write "<username>" > Response.Write rs("username") > Response.Write "</username>" > > Response.Write "<icq>" > Response.Write rs("icq") > Response.Write "</icq>" > > Response.Write "</message>" > rs.MoveNext > NEXT > END IF > > rs.Close > Set rs=nothing > con.Close > Set con=nothing >Response.Write "</threads>" >%> > > >i have this so far, however i get this error and have no idea on it yet >[quote] An error occured while Parsing an XML document. The reference to >entity "lt..." must end with the ';' delimiter.[/quote] > > > > ><!--- get message list ---> ><cfquery name="qGetXMLlist" datasource="#dsn#" username="#un#" >password="#pw#"> SELECT * >FROM guestbook >ORDER BY postdatetime desc ></cfquery> > > ><CFXML variable="messagesXML"> > ><message> ><cfoutput query="qGetXMLlist"> > <subject>#subject#</subject> > <number>#number#</number> > <email>#email#</email> > <url>#url#</url> > <body><![CDATA[#message#]]></body> > <sex>#sex#</sex> > <reply><![CDATA[#reply#]]></reply> > <icon>#icon#</icon> > <posted>#postdatetime#</posted> > <face>#face#</face> > <username>#username#</username> > <icq>#icq#</icq> > <br /> ></cfoutput> ></message> > ></CFXML> > ><cffile > action="write" > file="messages.xml" > output="#ToString(messagesXML)#"> ---> > ><!--- stuff the results into cfdump for viewing in the browser ---> <cfdump >var=#messagesXML#> > > > >tia > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| The annual ColdFusion User Conference is being held Sat 6/26 - Sun 6/27/04 8am-5pm in the Washington DC Area. http://www.houseoffusion.com/banners/view.cfm?bannerid=44 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182893 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

