[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

XML in ASP.Net page does not display in IE6

Asked by jedisteve in RSS, Programming for ASP.NET, Extensible Stylesheet Language Transformation (XSLT)

Tags: XML, ASP.Net 2.0, VB.Net, IE6

Hi,

I've produced the following .net page to output contains of a SQL server table, dependent on the page id, as a XML rss news feed. The page displays as I'd expect (with basic styling) in Firefox, IE7 and Safari, but just displays a blank page in IE6. any ideas why?

I'm pretty new to XML and learning as I go. Thanks for any help!
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:
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.xml" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
    Dim cv As New ControlValues
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Response.Clear()
        Response.ContentType = "application/rss+xml"
        Dim objX As New XmlTextWriter(Response.OutputStream, Encoding.UTF8)
        objX.WriteStartDocument()
        objX.WriteProcessingInstruction("xml-stylesheet", String.Format("title=""XSL_formatting"" type=""text/xsl"" href=""XSLTFile.xsl"""))
 
        objX.WriteStartElement("rss")
        objX.WriteAttributeString("version", "2.0")
        objX.WriteStartElement("channel")
        
        Dim res_string As String = String.Empty
        Dim res_id As String = String.Empty
        Dim res_type As String = String.Empty
        If Not cv.check(Request.QueryString("id")) = "" Then
            If cv.check(Request.QueryString("id")) = "News" Then
                res_id = "41"
                res_type = "new"
            ElseIf cv.check(Request.QueryString("id")) = "Events" Then
                res_id = "40"
                res_type = "eve"
            ElseIf cv.check(Request.QueryString("id")) = "Reports" Then
                res_id = "47"
                res_type = "rep"
            ElseIf cv.check(Request.QueryString("id")) = "Links" Then
                res_id = "48"
                res_type = "web"
            End If
            res_string = "res_type='" & res_type & "'"
        End If
 
        Dim cmd As New SqlCommand("Select TOP 4 * From _resource where " & res_string & " and siteid=4 and active=1 ORDER BY res_id DESC", New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString))
        cmd.Connection.Open()
        Dim dataRdr As SqlDataReader = cmd.ExecuteReader()
 
        objX.WriteElementString("title", " " & cv.check(Request.QueryString("id")) & " RSS Feed")
        objX.WriteElementString("link", "http://localhost:3849/ new/")
        objX.WriteElementString("description", "News Feed Description")
        objX.WriteElementString("language", "en-us")
        objX.WriteElementString("ttl", "60")
        'objX.WriteElementString("image", "")
        objX.WriteElementString("lastBuildDate", String.Format("{0:R}", DateTime.Now))
 
        Do While dataRdr.Read()
            objX.WriteStartElement("item")
            objX.WriteElementString("title", dataRdr("res_title").ToString())
            objX.WriteElementString("author", "")
            objX.WriteElementString("link", "http://localhost:3849/ new/details.aspx?type=" & res_type & "&id=" & res_id & "")
            objX.WriteStartElement("guid")
            objX.WriteAttributeString("isPermaLink", "true")
            objX.WriteString("http://localhost:3849/ new/details.aspx?type=" & res_type & "&id=" & res_id & "")
            objX.WriteEndElement()
            objX.WriteElementString("pubDate", String.Format("{0:R}", dataRdr("res_date")))
            objX.WriteStartElement("category")
            'objX.WriteString(dataRdr("lastname").ToString())
            objX.WriteEndElement()
            
            If dataRdr("res_description").ToString.Length > 97 Then
                objX.WriteElementString("description", dataRdr("res_description").ToString().Substring(0, 97) & "...")
            Else
                objX.WriteElementString("description", dataRdr("res_description"))
            End If
            
            objX.WriteEndElement()
        Loop
 
        objX.WriteEndElement()
        objX.WriteEndElement()
        objX.WriteEndDocument()
        objX.Flush()
        objX.Close()
        Response.End()
    End Sub
    
</script>
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>
 
 
styling:
 
<?xml version="1.0" encoding="utf-8"?>
 
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
	<xsl:template match="/">
		<html>
			<body>
				<h2>Test</h2>
				<table border="1">
					<tr bgcolor="#9acd32">
						<th>Title</th>
						<th>link</th>
					</tr>
					<xsl:for-each select="rss/channel/item">
						<tr>
							<td>
								<xsl:value-of select="title"/>
							</td>
							<td>
								<xsl:value-of select="link"/>
							</td>
						</tr>
					</xsl:for-each>
				</table>
			</body>
		</html>
	</xsl:template>
 
</xsl:stylesheet>
[+][-]09/24/09 05:01 AM, ID: 25412309Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: RSS, Programming for ASP.NET, Extensible Stylesheet Language Transformation (XSLT)
Tags: XML, ASP.Net 2.0, VB.Net, IE6
Sign Up Now!
Solution Provided By: BigRat
Participating Experts: 1
Solution Grade: A
 
[+][-]09/24/09 05:04 AM, ID: 25412326Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/09 05:15 AM, ID: 25412410Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/09 06:16 AM, ID: 25412979Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/24/09 06:44 AM, ID: 25413248Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/09 07:59 AM, ID: 25414037Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/24/09 09:12 AM, ID: 25414938Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/25/09 12:18 AM, ID: 25420623Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625