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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:05:14+00:00 2026-05-17T15:05:14+00:00

Here’s the situation: I have a client who’s issued me an XML schema, and

  • 0

Here’s the situation: I have a client who’s issued me an XML schema, and my software converts their records from tab-delimited to XML.

One of those fields, “file-sequence,” is typed as an integer in the schema. However, the client’s client (the integration target) wants that integer zero-padded and 4 digits long (EG, <file-sequence>0001</file-sequence>) in the actual output XML.

I’m outputting using serialization, which is nice and automatic and painless. However, because the field is typed as an integer in the XSD, the file-sequence field comes out as <file-sequence>1</file-sequence>. Which makes sense. 🙂

So far I’ve narrowed potential answers down to three options:

  1. Edit the schema and change the type to string. Zero-pad the sequence number upon updating the field. Downside: I have to remember to do this anytime the integration target changes the schema (as they have about a half-dozen times already).

  2. Forego using XML serialization, manually generating the XML in code. Downside: A lot of work, possibly error-prone, a serious code-smell (to me).

  3. Serialize to an in-memory stream, get the raw XML out of that, pad the integer there. Downsides: Feels really dirty, still a lot of work.

Are there any other options? If not, which option here is the right way to do this? (I’m thinking option 1 is probably cleanest.)

  • 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-17T15:05:14+00:00Added an answer on May 17, 2026 at 3:05 pm

    Honestly, option 1 is the only real option. If the target cares about the number of characters in the string, then the field is not an integer; it’s a string that’s restricted only to numeric digits.

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

Sidebar

Related Questions

Here total two union binding three queries, first query retrieving records from a virtual
here is my problem: I have a jList and a popup menu. When I
Here is an excerpt from Mixed Effects Models in S and S-Plus page 238
here's the code: #include <string> class Config { public: static const std::string asdf =
Here's my simple first attempt at a python extension using boost. Can someone help
here's what I've got so far - i really need to ban any tags
Here is a snippet of my JavaScript Code that I want to DRY up:
Here's my scenario: $foo = bar; one() { two() { three() { // need
Here's how standard section header views handle scrolling/overlaping: I'm trying to replicate the same
Here is my T-SQL query SELECT ProductID, VendorID, ProductName= MAX(ProductName), VendorName = MAX(VendorName), IsActive

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.