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 4589194
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:01:51+00:00 2026-05-21T22:01:51+00:00

I want the option to omit the xmlns:xsi, xmlns:xsd and xmlns attributes from xml

  • 0

I want the option to omit the xmlns:xsi, xmlns:xsd and xmlns attributes from xml content. When doing so deserialization is failing.

This is the xsd definition:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema id="CSVDataPluginConfig"
    targetNamespace="http://tempuri.org/CSVDataPluginConfig.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/CSVDataPluginConfig.xsd"
    xmlns:mstns="http://tempuri.org/CSVDataPluginConfig.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
  <xsd:element name="CSVDataPluginConfig" type="CSVDataPluginConfig"/>
  <xsd:complexType name="CSVDataPluginConfig">
  ...
  </xsd:complexType>
</xsd:schema>

The xsd.exe code generator is giving this:

[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(
    Namespace="http://tempuri.org/CSVDataPluginConfig.xsd")]
[System.Xml.Serialization.XmlRootAttribute(
    Namespace="http://tempuri.org/CSVDataPluginConfin.xsd", IsNullable=false)]
public partial class CSVDataPluginConfig {
}

This is the sample of xml content that deserializes successfully:

<?xml version="1.0" encoding="utf-16"?>
<CSVDataPluginConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://tempuri.org/CSVDataPluginConfig.xsd">
...
</CSVDataPluginConfig>

For simplicity and making it easier to handwrite the xml, I want to be able to successfully deserialize the following:

<CSVDataPluginConfig>
...
</CSVDataPluginConfig>

I am deserializing using this extension method:

    public static T DeserializeXML<T>(this string xml)
    {
        T obj;
        using (StringReader reader = new StringReader(xml))
        {
            obj = (T)new XmlSerializer(typeof(T)).Deserialize(reader);
            reader.Close();
        }
        return obj;
    }

Using Visual Studio 2008, what are my options, and what is the best option?

  • 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-21T22:01:52+00:00Added an answer on May 21, 2026 at 10:01 pm

    Sorry, you don’t actually have an option.

    The author of the XML is (properly) using namespaces. That means the XML is in a namespace, and you have to use it.

    In fact, with a good XML Editor, the namespaces make it easier to hand-enter it. The namespaces map to a schema, and the schema can inform the XML editor how to help you with the data entry. Try the XML editor in Visual Studio 2010 and you’ll see what I mean. Just make sure that the schema is available (maybe in the same project), and it will go as far as filling in the XML with placeholders as soon as you type <CSVTAB

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to remove the option Invite Only from Membership Requests in Organic Groups.
I want to add option in the actionbar to change my record display from
I want to set a menu option icon for a drawable that is in
I want to transform a List[Option[T]] into a Option[List[T]] . The signature type of
I want to know if Netbeans has some option or setting that will allow
I want to implement in my application the option to send the current user
What is the best option if I want to upgrade old C-code to newer
I want the user to be able to select an option, which would change
I want to run mallet using the --use-ngrams true option but can't seem to
I want to reset a file upload field when the user selects another option.

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.