![]() |
|
|
|
#1 |
|
I have a .asp document on my server it goes as follows
--- <?xml version="1.0" standalone='yes'?> <Restaurants> <% Dim objConn Dim objRS set objConn = Server.CreateObject("ADODB.Connection") set objRS = server.CreateObject("ADODB.recordset") objconn.open "Driver={SQL Server};Server=localhost;Uid=user;Pwd=pass;Databas e=me" objRS.activeconnection = objConn objRS.open "SELECT RestaurantName, PremisesAddressLine1 as Address FROM tblRestaurantAccounts WHERE franchiseID= 16 and accountstatus=0" do until objRS.eof response.write vbtab & "<Restaurant>" & vbcrlf response.write vbtab & vbtab & "<Shop>" & objRS.fields("Restaurantname").value & "</Shop>" & vbcrlf response.write vbtab & vbtab & "<Address>" & objRS.fields("address").value & "</Address>" & vbcrlf response.write vbtab & "</Restaurant>" & vbcrlf objRS.movenext loop objRS.close objConn.close set objRS = nothing set objConn = nothing %> </Restaurants> --- the only problem is that it chokes when it gets a record entry that contains a "&". what code do i need or what modifications to my code to let this .asp document display a "well-formed" xml document? thanks for your help Jonathan Carl Broderick jbroderick@gmail.com |
|
|
|
|
#2 |
|
Posts: n/a
|
How about converting & to & ?
Replace(objRS.fields("Restaurantname").value,"&",& amp;") Cheers |
|
|
|
#3 |
|
Posts: n/a
|
OOPS - i missed a "
Replace(objRS.fields("Restaurantname").value,"&"," &") hiredgoon wrote: > How about converting & to & ? > > Replace(objRS.fields("Restaurantname").value,"&",& amp;") > > Cheers |
|
|
|
#4 |
|
Posts: n/a
|
|
|
|
|
#5 |
|
Posts: n/a
|
Excerlent, works a treat, cheers mate
hiredgoon wrote: > OOPS - i missed a " > > Replace(objRS.fields("Restaurantname").value,"&"," &") > > Cheers |
|