unplugged_web Posted November 8, 2010 Share Posted November 8, 2010 I wonder if somebody can help me please.I'm using this to get the results from a database and the parse them as xml.The xml will then be used with Wapple to display on mobile phones.I've got this: <%response.ContentType = "text/xml"set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0;"conn.open Server.MapPath("/database/database.mdb")sql="Select idate,hits,title,id from listings where active <> 0 order by idate desc"set rs=Conn.Execute(sql)response.write("<?xml version='1.0' encoding='ISO-8859-1'?>")response.write("<wapl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://wapl.wapple.net/wapl.xsd">")response.write("<layout>")response.write("<row>")response.write("<cell>")while (not rs.EOF)response.write("<externalLink>")response.write("<url>http://www.somewhere.com</url>")response.write("<title>" & rs("title") & "</title>")response.write("</externalLink>")rs.MoveNext()wendrs.close()conn.close()response.write("</cell>")response.write("</row>")response.write("<layout>")response.write("</wap>")%> but get an error saying Microsoft VBScript compilation error '800a03ee'Expected ')'/test.asp, line 11response.write("<wapl xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://wapl.wapple.net/wapl.xsd">")---------------------------------^I know this relates to the response.write("<wapl xm;ns... line, but I need that there for it to work with wapl (the code Wapple use)Thanks in advance for any help in getting this working Link to comment Share on other sites More sharing options...
jeffman Posted November 8, 2010 Share Posted November 8, 2010 Do the internal quotation marks need to be escaped? Link to comment Share on other sites More sharing options...
unplugged_web Posted November 8, 2010 Author Share Posted November 8, 2010 Do the internal quotation marks need to be escaped?I've just tried that and got this error in a web browser:This page contains the following errors:error on line 1 at column 1074: xmlParseEntityRef: no nameBelow is a rendering of the page up to the first error.and this one on the phone browser:WAPL ERROR: Premature end of data in tag wapl line 1I've never used ASP before so I'm not sure if the problem is there or with the XML itself. :)Thanks for helping Link to comment Share on other sites More sharing options...
jeffman Posted November 8, 2010 Share Posted November 8, 2010 Did you use a backslash or another double quote to escape? VBScript is weird. Link to comment Share on other sites More sharing options...
unplugged_web Posted November 8, 2010 Author Share Posted November 8, 2010 Did you use a backslash or another double quote to escape? VBScript is weird.I'm pleased you said that - I was starting to think it was me that was causing it to go wrong. This is exactly what I've got:<%response.ContentType = "text/xml"set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0;"conn.open Server.MapPath("/database/database.mdb")sql="Select idate,hits,title,id from listings where active <> 0 order by idate desc"set rs=Conn.Execute(sql)response.write("<?xml version='1.0' encoding='UTF-8'?>")response.write("<wapl xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://wapl.wapple.net/wapl.xsd'>")response.Write("head")response.write("<title>Web To The Mobile Version</title>")response.Write("/head")response.write("<layout>")response.write("<row>")response.write("<cell>")while (not rs.EOF)response.write("<externalLink>")response.write("<url>http://go.wapple.net</url>")response.write("<title>" & rs("title") & "</title>")response.write("</externalLink>")rs.MoveNext()wendrs.close()conn.close()response.write("</cell>")response.write("</row>")response.write("<layout>")response.write("</wap>")%> Link to comment Share on other sites More sharing options...
unplugged_web Posted November 8, 2010 Author Share Posted November 8, 2010 I've changed it so that I now have CDATA surrounding the title and that seems to have fixed it.So I've now got: response.Write("<![CDATA[")response.write("<title>" & rs("title") & "</title >")response.Write("]]>") Thanks for you're help Link to comment Share on other sites More sharing options...
jeffman Posted November 8, 2010 Share Posted November 8, 2010 I never would have thought of that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.