Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3442642
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:41:38+00:00 2026-05-18T08:41:38+00:00

I built the following code to output XML: public static XDocument Serialize<T>(this T source)

  • 0

I built the following code to output XML:

    public static XDocument Serialize<T>(this T source) where T : class
    {
        XDocument document = new XDocument();
        XmlReflectionImporter xmlReflection = new XmlReflectionImporter();
        XmlTypeMapping xmlMapping = xmlReflection.ImportTypeMapping(typeof(T));
        XmlSerializer xmlSerializer = new XmlSerializer(xmlMapping);

        using (XmlWriter xmlWriter = document.CreateWriter())
            xmlSerializer.Serialize(xmlWriter, source);

        return document;
    }

Then in one of my aspx pages I have the following output:

    XDocument output = GetSomeXmlSerializedOutput();
    output.Save(Response.OutputStream);  

GetSomeXmlSerializedOutput() is basically output from feeding a class to the Serialize extension method.

The page’s header looks like this:

<%@ Page Language="C#" CodeBehind="Alerts.aspx.cs" Inherits="Infinix.Diageo.WebApp.Get.Alerts" ContentType="text/xml" %>

Firefox correctly assumes from just the ContentType that the output is XML. IE doesn’t. The output XML, for reference, is:

<?xml version="1.0" encoding="utf-8"?>
<ALERTS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ALERT>
    <ID>1</ID>
    <TYPE>ALERT</TYPE>
    <NAME>neim</NAME>
    <DETAIL>diteil</DETAIL>
    <DATE>11/28/2010</DATE>    
    <TIME>13:50:02</TIME>
  </ALERT>
  <ALERT>
    <ID>2</ID>
    <TYPE>EVENT</TYPE>
    <NAME>iven</NAME>
    <DETAIL>ditel</DETAIL>    
    <DATE>11/28/2010</DATE>
    <TIME>13:50:15</TIME>
  </ALERT>
  <ALERT>
    <ID>3</ID>
    <TYPE>BIRTHDAY</TYPE>
    <NAME>pijazo</NAME>    
    <DETAIL>grande!</DETAIL>
    <DATE>11/28/2010</DATE>
    <TIME>13:50:23</TIME>
  </ALERT>
</ALERTS>

Why doesn’t IE recognize this output as genuine XML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:41:39+00:00Added an answer on May 18, 2026 at 8:41 am

    Your page directive needs to set the ContentType="application/xml".

    <%@ Page Language="C#" CodeBehind="Alerts.aspx.cs"
        Inherits="Infinix.Diageo.WebApp.Get.Alerts" ContentType="application/xml" %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building an XML document successfully with the following code: public function build($result)
I have the following code: class Array { public: int aaa; Array():aaa(1){} void print()
Basically, I have the following code: public class MyDictionary<TKey, TValue> : IDictionary<TKey, TValue> {
I build a CodeCompileUnit and the following code outputs a C# source code file,
In the following code segment when built I keep breaking when adding the OnClickListener
i inteded to show xml format on the console from following basic code :
Given the following code from RssToolkit in RssXmlHelper.cs: /// <summary> /// Returns XML of
Consider the following code and its output: Code #!/usr/bin/perl -w use strict; use Data::Dumper;
If I run the following code: BitSet test = new BitSet(20); System.out.println(Bitset size is
Consider the following C# code: Decimal number = new decimal(8.0549); Decimal rounded = Math.Round(number,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.