Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/12/2009, 18:47
truskyvb
 
Fecha de Ingreso: octubre-2008
Mensajes: 188
Antigüedad: 15 años, 6 meses
Puntos: 3
Validar página asp

Hola a todos. Estoy renovando todo el sito web y validándolo en W3C pero he tropezado con un probema que no se resolver. Si podeis ayudarme os lo agradezco.

Tengo una página.asp que lee un fichero txt.

El código es:
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim ThisLine, PrintLine
Dim FileObject
Dim GuestBookFile
Dim InputStream
Dim x
Dim OutputStream
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
GuestBookFile = Server.MapPath("guestbook.txt")
Set InputStream = FileObject.OpenTextFile(GuestBookFile, ForReading, False)
Do While Not InputStream.AtEndOfStream
ThisLine = split(InputStream.ReadLine, "vbCrLf ")
PrintLine = "<hr>" + PrintLine

PrintLine = "<br/>" + PrintLine

For x = LBound(ThisLine) To UBound(ThisLine)

If x = UBound(ThisLine) + 1 Then
PrintLint = ThisLine(x) + "<br/>" + PrintLine
Else
PrintLine = ThisLine(x) + "<br/>" + PrintLine
End If

Next

PrintLine = "<br/>" + PrintLine

Loop

InputStream.Close
Set OutputStream = Nothing
Set FileObject = Nothing

Response.Write replace(PrintLine, "//vbReturn//", " <br> ")

%>

Pues bien, si yo valido esta página con el fichero txt vacio (sin datos), no hay problema, pero en cuanto en ese txt hay algo escrito, no paso la validación, el W3C lo lee y supongo que como no es códio htm, da error. El caso es que no se como resolverlo.

Espero haberlo explico bien.

Gracias de antemano. Un saludo