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

  • SEARCH
  • Home
  • 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 4033276
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:49:41+00:00 2026-05-20T11:49:41+00:00

I’m a student just learning xml and c#. I’m writing a program that will

  • 0

I’m a student just learning xml and c#. I’m writing a program that will read in xml data, process it, and write it back to the xml. Pretty standard stuff. Specifically, the program is going to allow the user to create/generate characters and add new types of information (clans, skills, bonuses, etc.) for the L5R tapletop RPG game, as requested from a friend of mine. It’s a learning experience and will give me something to put in my portfolio when I’m done.

I’m creating the xsd’s and xml’s first, and will get past the pseudocode phase once that’s finished.

In my XMLs, I’m doing something like…

<clan clID="clanX">
  <clName>...</clname>
  <bonus bnID="clXbonusX>
    <bnName>...</bnName>
    <modBy>someNum</modBy>
  </bonus>
</clan>

Since I haven’t the experience doing this, once I start actually programming, the ID strings are going to change based on the user inputting new clan and bonus names and such.

Now I’m thinking a loop to do my sorting/renaming. But since the X’s need to be variable characters, how would I go about ensuring that only the X gets changed, and specifically increments from 9 to 10 and not the next up ASCII value?

I’m intending to use the id’s to pull in the start of a new clan element, and then to denote specifically which bonus (as the number of bonuses can vary) to put into the variables I’ll be creating to hold them and their value.

Basically, the program will check the name of the bonus, add it to 1 array, and increase it by X in a parallel array.

Thanks in advance for any help!

  • 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-20T11:49:42+00:00Added an answer on May 20, 2026 at 11:49 am

    once I start actually programming the ID strings are going to change based on the user inputting new clan and bonus names and such.

    IDs that can be changed aren’t really IDs. It seems, from your comment to Shekhar_Pro’s answer, that your thinking is that IDs need to be unique within the scope of an XML document. That’s true if and only if you’re using the ID constraint in your DTD or schema. ID constraints aren’t really a very common use case, and I don’t think this is one.

    The bigger question is: do you really need IDs at all? Assuming, for instance, that the names of the clans and the traits aren’t to change over time – new ones might be added, but AEG isn’t going to change the old ones anytime soon – if your document looked like this:

    <clan name="Scorpion">
       <bonus trait="Honor" value="-1"/>
       <bonus trait="Intelligence" value="+1"/>
    </clan>
    

    not only is your document more concise, you can find all of the bonus elements for the Bayushi family with the XPath:

    //clan[@name='Scorpion']/bonus
    

    In your schema, you can indicate that clan names need to be unique by using:

    <xsd:element name="clan" type="clanType">
      <xsd:unique name="nameKey">
        <xsd:selector xpath="*/clan"/>
        <xsd:field xpath="@name"/>
      </xsd:unique>
    </xsd:element>
    

    You may need to jigger with the XPath in the selector depending on where in your document the clan elements live.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters

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.