Contents of hotelsMakeXML.asp
<!--#include file = "connect.inc"-->
<%
dim strSQL, rs, QQ, CRLF, strFilename, strLine, oFSO, oFile
strSQL = "SELECT * FROM hotels"
set rs = conn.execute( strSQL)
QQ = chr(34)
CRLF = vbcrlf
strFilename = server.mapPath( "hotels.xml")
set oFSO = server.createObject( "scripting.fileSystemObject")
set oFile = oFSO.createTextFile( strFilename, true)
strLine = "<?xml version=" & QQ & "1.0" & QQ & " encoding=" & QQ & "ISO-8859-1" & QQ & " standalone=" & QQ & "no" & QQ & " ?>"
oFile.writeLine( strLine)
strLine = "<hotels xmlns:xs=" & QQ & " http://www.w3.org/2001/XMLSchema-instance" & QQ & " xs:noNamespaceSchemaLocation=" & QQ & " http://www20.brinkster.com/plpg/db/xml/geneva/hotels.xsd" & QQ & ">"
oFile.writeLine( strLine)
do while not rs.EOF
strLine = " <hotel>"
oFile.writeLine( strLine)
strLine = " <hotelID>" & trim( rs( "hotelID")) & "</hotelID>"
oFile.writeLine( strLine)
strLine = " <name>" & trim( rs( "name")) & "</name>"
oFile.writeLine( strLine)
strLine = " <addr1>" & trim( rs( "addr1")) & "</addr1>"
oFile.writeLine( strLine)
strLine = " <addr2>" & trim( rs( "addr2")) & "</addr2>"
oFile.writeLine( strLine)
strLine = " <addr3>" & trim( rs( "addr3")) & "</addr3>"
oFile.writeLine( strLine)
strLine = " <tel>" & trim( rs( "tel")) & "</tel>"
oFile.writeLine( strLine)
strLine = " <fax>" & trim( rs( "fax")) & "</fax>"
oFile.writeLine( strLine)
strLine = " <web>" & trim( rs( "web")) & "</web>"
oFile.writeLine( strLine)
strLine = " <email>" & trim( rs( "email")) & "</email>"
oFile.writeLine( strLine)
strLine = " <descr>" & trim( rs( "descr")) & "</descr>"
oFile.writeLine( strLine)
strLine = " <amenities>" & trim( rs( "amenities")) & "</amenities>"
oFile.writeLine( strLine)
strLine = " <picture filename=" &QQ& "images/" & trim( rs( "picture")) &QQ& " width=" &QQ& trim( rs( "width")) &QQ& " height=" &QQ& trim( rs("height")) &QQ& " alt=" &QQ& trim( rs( "alt")) &QQ& "></picture>"
oFile.writeLine( strLine)
strLine = " </hotel>"
oFile.writeLine( strLine)
rs.moveNext
loop
strLine = "</hotels>"
oFile.writeLine( strLine)
oFile.Close
set oFile = nothing
set oFSO = nothing
response.redirect( "hotelsDataAdmin.asp")
%>