ASP programiranje: Pisanje XML datoteka
Ovdje je jednostavan funkciju za pisanje XML datoteka izravno s ASP stranice.
Ova skripta uzima podatke iz baze podataka programa Access mdb podršku za format, ali možete povezati s bilo bazu podataka bilo koje vrste.
<% @ Language = VBScript%> <% 'Response.ContentType = "text / xml" Response.CodePage = 65001 Response.Charset = "UTF-8" Response.Write ("<? Xml version = 0,0 '1 'encoding =' ISO-8859-1'?>"& VbCrLf) Response.Write ("<group>" & vbCrLf) Set conn = Server.CreateObject ("ADODB.Connection") conn.Open "DRIVER = (Microsoft Access Driver (*. mdb)); DBQ =" & Server.MapPath ("MioDB.mdb)
Set rs = Server.CreateObject ("ADODB.Recordset") sql = "SELECT * FROM MiaTabella" rs.open SQL, conn, 3, 3 ako ne onda rs.eof ContentId = rs ("IDTab) ContentPal = rs ("SitoTab) ContentNome = rs ("NomeTab) ContentDescrizione = rs ("DescrizioneTab) ContentUrl rs = ("UrlTab) ContentClip = rs ("FlashTab) Response.Write ("<web id = '" & ContentId & "' palid = '" & ContentPal & "'")
Response.Write ("title = '" & ContentNome & "' link = '" & ContentUrl & "'") Response.Write ("thumb = '" & ContentId & "' isječak = '" & ContentClip & "'") Response.write ("><![ CDATA ["& ContentDescrizione &"]]></ Web>" & vbCrLf) End If rs.Close conn.Close Set rs = Nothing Set conn = Nothing Response.Write ("</ grupi>" & vbCrLf) %>
Povezivati se Članak
Vidi:























































U zadnje vrijeme Komentirajte