Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default select -> xml file?

    Hello

    Im trying to build a simple page that outputs xml. but i dont see the
    browser understand that contenttype or something like that since the nodes
    arent "clickable", i need to use view source to see it....... was wondering
    if there is an other way of doing this or if this is the best way, or if
    there is something i can add so the browser treat the content as it would if
    i open up a xml file in explorer.


    <%
    response.contenttype = "text/xml"

    'i open db here
    sql="select * from employees"
    set rs=conn.execute(sql)

    response.write("<?xml version=""1.0"" encoding=""UTF-8""?>")
    response.write("<ROOT>")

    if not rs.eof then
    do until rs.eof
    response.write("<Employee>"&rs("employee")&"</Employee>")

    rs.movenext
    loop
    end if
    set conn=nothing

    response.write("</ROOT>")
    %>


    /Lasse


    Lasse Edsvik Guest

  2. Similar Questions and Discussions

    1. Can't select file to link text to
      When in 'edit page' mode and trying to link text to another web page, I get the error message: 'You can't select this file because it exceeds the...
    2. Select File on the Server error
      Hey anyone out there know how I can fix this error... IO error on Server Communication CF MX7 local development server ( just installed) Prior...
    3. select for a text file
      Hi, I tried to make select query to a text file using the code below, <% sconnection="Provider=Microsoft.Jet.OLEDB.4.0;Data...
    4. select() max number of file descriptors
      It seems that my system's select call has a limitation of 1024 open file descriptors. I need to learn about this restriction as I am programming...
    5. Select a sound file from menu
      Using Director MX I have created an interactive tour with a sound file playing as background music. I would like to give the user a choice of music...
  3. #2

    Default Re: select -> xml file?

    Lasse Edsvik wrote:
    > Hello
    >
    > Im trying to build a simple page that outputs xml. but i dont see the
    > browser understand that contenttype or something like that since the
    > nodes arent "clickable", i need to use view source to see it.......
    > was wondering if there is an other way of doing this or if this is
    > the best way, or if there is something i can add so the browser treat
    > the content as it would if i open up a xml file in explorer.
    >
    >
    > <%
    > response.contenttype = "text/xml"
    >
    > 'i open db here
    > sql="select * from employees"
    > set rs=conn.execute(sql)
    >
    > response.write("<?xml version=""1.0"" encoding=""UTF-8""?>")
    > response.write("<ROOT>")
    >
    > if not rs.eof then
    > do until rs.eof
    > response.write("<Employee>"&rs("employee")&"</Employee>")
    >
    > rs.movenext
    > loop
    > end if
    > set conn=nothing
    >
    > response.write("</ROOT>")
    > %>
    >
    >
    > /Lasse
    If I change your code to this (commenting out the ADO code):
    <%
    response.contenttype = "text/xml"

    'i open db here
    ' sql="select * from employees"
    'set rs=conn.execute(sql)

    response.write "<?xml version=""1.0"" encoding=""UTF-8""?>"
    response.write "<ROOT>"

    'if not rs.eof then
    ' do until rs.eof
    ' response.write("<Employee>"&rs("employee")&"</Employee>")
    response.write "<Employee>A</Employee>"
    ' rs.movenext
    ' loop
    'end if
    'set conn=nothing

    response.write "</ROOT>"
    %>

    I see the proper result in the browser. Do you?

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

  4. #3

    Default Re: select -> xml file?

    Bob,

    I need to use view source to see all elements and structure.......

    i use IE6

    /Lasse


    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:eDg04eS1DHA.2544@TK2MSFTNGP10.phx.gbl...
    > Lasse Edsvik wrote:
    > > Hello
    > >
    > > Im trying to build a simple page that outputs xml. but i dont see the
    > > browser understand that contenttype or something like that since the
    > > nodes arent "clickable", i need to use view source to see it.......
    > > was wondering if there is an other way of doing this or if this is
    > > the best way, or if there is something i can add so the browser treat
    > > the content as it would if i open up a xml file in explorer.
    > >
    > >
    > > <%
    > > response.contenttype = "text/xml"
    > >
    > > 'i open db here
    > > sql="select * from employees"
    > > set rs=conn.execute(sql)
    > >
    > > response.write("<?xml version=""1.0"" encoding=""UTF-8""?>")
    > > response.write("<ROOT>")
    > >
    > > if not rs.eof then
    > > do until rs.eof
    > > response.write("<Employee>"&rs("employee")&"</Employee>")
    > >
    > > rs.movenext
    > > loop
    > > end if
    > > set conn=nothing
    > >
    > > response.write("</ROOT>")
    > > %>
    > >
    > >
    > > /Lasse
    >
    > If I change your code to this (commenting out the ADO code):
    > <%
    > response.contenttype = "text/xml"
    >
    > 'i open db here
    > ' sql="select * from employees"
    > 'set rs=conn.execute(sql)
    >
    > response.write "<?xml version=""1.0"" encoding=""UTF-8""?>"
    > response.write "<ROOT>"
    >
    > 'if not rs.eof then
    > ' do until rs.eof
    > ' response.write("<Employee>"&rs("employee")&"</Employee>")
    > response.write "<Employee>A</Employee>"
    > ' rs.movenext
    > ' loop
    > 'end if
    > 'set conn=nothing
    >
    > response.write "</ROOT>"
    > %>
    >
    > I see the proper result in the browser. Do you?
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >

    Lasse Edsvik Guest

  5. #4

    Default Re: select -> xml file?

    Lasse Edsvik wrote:
    > Bob,
    >
    > I need to use view source to see all elements and structure.......
    >
    > i use IE6
    >
    > /Lasse
    >
    I'm using IE6 as well, and I definitely see the XML without viewing source.
    When you view source, does the xml look correct? If it's not too much data,
    could you post the source so we can see if there are any problems with it?

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

  6. #5

    Default Re: select -> xml file?

    Bob,

    yep, its correct, to test i took some data from the source and saved it as
    text.xml and then it showed up properly in the browser. Tried with only 1
    row too, same result.......

    some content-type problem going on?

    /Lasse

    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:%23vAD$lS1DHA.2412@TK2MSFTNGP10.phx.gbl...
    > Lasse Edsvik wrote:
    > > Bob,
    > >
    > > I need to use view source to see all elements and structure.......
    > >
    > > i use IE6
    > >
    > > /Lasse
    > >
    >
    > I'm using IE6 as well, and I definitely see the XML without viewing
    source.
    > When you view source, does the xml look correct? If it's not too much
    data,
    > could you post the source so we can see if there are any problems with it?
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >

    Lasse Edsvik Guest

  7. #6

    Default Re: select -> xml file?

    Lasse Edsvik wrote:
    > Bob,
    >
    > yep, its correct, to test i took some data from the source and saved
    > it as text.xml and then it showed up properly in the browser. Tried
    > with only 1 row too, same result.......
    >
    > some content-type problem going on?
    >
    No clue - I've never seen this problem. Normally, I would try Google at this
    point, but I don't have much time this morning so I suggest you try it
    yourself.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows Guest

  8. #7

    Default Re: select -> xml file?

    Can you put a sample of the page up somewhere where we can try to view
    it?

    On Wed, 7 Jan 2004 15:18:40 +0100, "Lasse Edsvik" <lasse@nospam.com>
    wrote:
    >Bob,
    >
    >I need to use view source to see all elements and structure.......
    >
    >i use IE6
    >
    >/Lasse
    >
    >
    >"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    >news:eDg04eS1DHA.2544@TK2MSFTNGP10.phx.gbl...
    >> Lasse Edsvik wrote:
    >> > Hello
    >> >
    >> > Im trying to build a simple page that outputs xml. but i dont see the
    >> > browser understand that contenttype or something like that since the
    >> > nodes arent "clickable", i need to use view source to see it.......
    >> > was wondering if there is an other way of doing this or if this is
    >> > the best way, or if there is something i can add so the browser treat
    >> > the content as it would if i open up a xml file in explorer.
    >> >
    >> >
    >> > <%
    >> > response.contenttype = "text/xml"
    >> >
    >> > 'i open db here
    >> > sql="select * from employees"
    >> > set rs=conn.execute(sql)
    >> >
    >> > response.write("<?xml version=""1.0"" encoding=""UTF-8""?>")
    >> > response.write("<ROOT>")
    >> >
    >> > if not rs.eof then
    >> > do until rs.eof
    >> > response.write("<Employee>"&rs("employee")&"</Employee>")
    >> >
    >> > rs.movenext
    >> > loop
    >> > end if
    >> > set conn=nothing
    >> >
    >> > response.write("</ROOT>")
    >> > %>
    >> >
    >> >
    >> > /Lasse
    >>
    >> If I change your code to this (commenting out the ADO code):
    >> <%
    >> response.contenttype = "text/xml"
    >>
    >> 'i open db here
    >> ' sql="select * from employees"
    >> 'set rs=conn.execute(sql)
    >>
    >> response.write "<?xml version=""1.0"" encoding=""UTF-8""?>"
    >> response.write "<ROOT>"
    >>
    >> 'if not rs.eof then
    >> ' do until rs.eof
    >> ' response.write("<Employee>"&rs("employee")&"</Employee>")
    >> response.write "<Employee>A</Employee>"
    >> ' rs.movenext
    >> ' loop
    >> 'end if
    >> 'set conn=nothing
    >>
    >> response.write "</ROOT>"
    >> %>
    >>
    >> I see the proper result in the browser. Do you?
    >>
    >> Bob Barrows
    >> --
    >> Microsoft MVP -- ASP/ASP.NET
    >> Please reply to the newsgroup. The email account listed in my From
    >> header is my spam trap, so I don't check it very often. You will get a
    >> quicker response by posting to the newsgroup.
    >>
    >>
    >
    >
    Brynn Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139