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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:17:25+00:00 2026-05-18T04:17:25+00:00

The XML schema specifies an index of files. Below is an example of how

  • 0

The XML schema specifies an index of files. Below is an example of how the XML file should look like.

<?xml version="1.0" encoding="utf-8"?>
<fIndex xsi:schemaLocation="http:address fIndex.xsd" xmlns="address" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <f>
    <foN>SomeDir</foN>
    <fiN>file1.txt</fiN>
  </f>
  <f>
    <foN>SomeDir</foN>
    <fiN>file2.txt</fiN>
  </f>
</fIndex>

I used xsd to create the classes needed for the XML. Then filled in some sample code to match the example above.

class Program
    {
        static void Main(string[] args)
        {
            fileIndexType table = new fileIndexType();

            fileIndexTypeF element1 = new fileIndexTypeF();
            fileIndexTypeF element2 = new fileIndexTypeF();

            element1.fiN = @"C:\SomeDir";
            element1.foN = @"file1.txt";
            element2.fiN = @"C:\SomeDir";
            element2.foN = @"file2.txt";

            fileIndexTypeF[] files = new fileIndexTypeF[2] { element1, element2 };
            table.f = files;
        }
    }

How do I create the above XML file?

  • 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-18T04:17:25+00:00Added an answer on May 18, 2026 at 4:17 am

    You need to serialize the objects.

    The XmlSerializer class can be used for this:

    XmlSerializer serializer = new XmlSerializer(typeof(fileIndexType));
    using(Stream writer = new FileStream(filename, FileMode.Create))
    {
      serializer.Serialize(writer, table );
      writer.Close();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's consider the following XML Schema: <?xml version=1.0 encoding=UTF-8?> <schema targetNamespace=http://www.example.org/library elementFormDefault=qualified xmlns=http://www.w3.org/2001/XMLSchema xmlns:lib=http://www.example.org/library>
Below is the format MSDN specifies a Publisher Configuration File (policy) should be for
XML Schema specifies occurrence indicators (maxOccurrence, minOccurrence). Is there a best practice in which
XML schema of XHTML Basic 1.1 ( xhtml-basic11-modules-1.xsd file ) contains such a redefine:
I've got a XML Schema (xsd file) snippet bellow, in which I want the
I have an xml schema and csv data to generate corresponding xml files. I
I am attempting to use JAXB to unmarshall an XML files whose schema is
I've got an xml schema which specifies a default value for an optional field...
The XML Schema Part 2 specifies that an instance of a datatype that is
I am receiving XML from a server whose schema specifies nearly every element as:

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.