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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:58:51+00:00 2026-06-03T02:58:51+00:00

I get a set of ‘Attributes’ with default values and I want to create

  • 0

I get a set of ‘Attributes’ with default values and I want to create a string which is a part xml document as below(not a complete xml document). I want to have a ‘tab’ in between every attribute. I’ve found string concatenation is the workable option in this case. In .Net is there any better way of doing this?

<XmlNodes>
<ChildNode Attribute1 ="100"    Attribute2="200"    Attribute3 ="0"/>
<ChildNode Attribute1="100"     Attribute2="200"    Attribute3 ="0"/>
...
</XmlNodes>
  • 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-06-03T02:58:52+00:00Added an answer on June 3, 2026 at 2:58 am

    Here’s a fun little hack that at least only resorts to string manipulation late in the piece:

    var nodes = new XElement("XmlNodes");
    foreach (var i in Enumerable.Range(1,10))
    {
        nodes.Add(new XElement("ChildNode", 
            new XAttribute("Attribute1", 100), 
            new XAttribute("Attribute2", 200), 
            new XAttribute("Attribute3", 0)));
    }
    
    var result = nodes.ToString().Replace("\" A", "\"\tA"); // **" A** becomes **"\tA**
    

    But I maintain that if this is about providing ‘templates’ for people to edit then you’re best off getting them to edit it in a non-XML format (like CSV) and then convert to XML when you parse it.

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

Sidebar

Related Questions

How do you set/get the values of attributes of t given by x ?
i want to create custom object to get set value on it. -(id)initWithURLString:(NSString *)url
Given a string: Person.Address.Postcode I want to be able to get/set this postcode property
The below code is a quick script in T-SQL which builds Get Set properties
I just found out that I can get/set a default namespace in my web
I only get set the text field in MySQL to 255, if I want
I want to do some database operations and get/set a cookie before the front
I'm making a utility to get/set property values when the property has custom-named getters
I want to know if i can get/set application properties in Mono under Linux,
all i want to do is this: Public Property TabsCollection()() as String()() Get Return

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.