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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:31:51+00:00 2026-05-31T14:31:51+00:00

Say I have an xml file like so: <ArrayOfInternetProxy xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema> <InternetProxy> <ProxyName />

  • 0

Say I have an xml file like so:

<ArrayOfInternetProxy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <InternetProxy>
    <ProxyName />
    <ProxyIP>23.19.34.127:8800</ProxyIP>
    <Username />
    <Password />
  </InternetProxy>
</ArrayOfInternetProxy>

There where many more <InternetProxy> in the xml file, but I removed them for clarity.

<InternetProxy> representes an object in my program, while <ArrayOfInternetProxy> represents an array of said object.

How can I change the tags <ArrayOfInternetProxy> and <InternetProxy> to be whatever I like?

I managed to change the attributes by using:

    [XmlElement("ProxyName")]
    public string ProxyName { get; set; }

But this doesn’t work on the other tags.

Thanks.

My class:

public class InternetProxy //I want to change this in the xml output
{
    [XmlElement("ProxyName")]
    public string ProxyName { get; set; }

    [XmlElement("ProxyIP")]
    public string Address { get; set; }

    [XmlElement("Username")]
    public string UserName { get; set; }

    [XmlElement("Password")]
    public string Password { get; set; }
}

Edit:

Here is what I tried, why doesn’t this work for me??

[XmlElement("Proxies")]
[XmlArray("Proxies")]
List<InternetProxy> proxies;
  • 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-31T14:31:52+00:00Added an answer on May 31, 2026 at 2:31 pm

    You should have something like:

    [XmlArray("Proxies")]
    public InternetProxy[] InternetProxy
    {
       get;
       set;
    }
    

    To control how it’s serialized you can apply following attributes:

    • XmlArrayAttribute: it’ll change the name of the array (your actual ArrayOfInternetProxy).
    • XmlArrayItemAttribute: it’ll change the name of the array items (your actual InternetProxy).

    If you serialize directly your array (so you don’t have such property with the array) you should apply XmlType attribute, like:

    [XmlType(TypeName="Proxies")]
    public class InternetProxy
    {
    }
    

    See http://msdn.microsoft.com/en-us/library/2baksw0z(v=vs.10).aspx for details.

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

Sidebar

Related Questions

We have XML file like below... <?xml version='1.0'?> <T0020 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://www.safersys.org/namespaces/T0020V1 T0020V1.xsd xmlns=http://www.safersys.org/namespaces/T0020V1> <IRP_ACCOUNT>
Let's say I have an empty XML file like so: <root></root> And I want
Let's say I have a line in an XML file like the following (derived
Say I have an xml file like: <Filters> <Blur Name=Blur01 /> <Sharpen Name=Sharpen01 Amount=5
Say I have an XML file like the following: <holidays> <holiday1 val=New Years, 01/01,
Let's say I have an XML file that looks like this: <a id=x> <b>
Let's say I have an xml file like this: <root> <a><b><c> w </c></b></a> <x><y><z>
Let's just say I have an XML file that looks like this: <?xml version=1.0
lets say i have an xml file path.xml that goes like this: <paths> <path
Say I have an XML file which looks like this: <?xml version=1.0 encoding=UTF-8?> <Project

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.