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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:02:02+00:00 2026-05-20T20:02:02+00:00

I have an XML file, I need to extract values from it, and put

  • 0

I have an XML file, I need to extract values from it, and put them in another XML file.

Questions:

  1. Another person is creating the “schema” for the resulting XML file. Is there something that person can give me that will automate the inserting of the values? Do I even need to extract anything from the XML, or can something like a XSLT just do all the transformation?

  2. Is there a problem with this XML structure below? I tried using xsd2code to generate objects but nothing will load when I use the LoadFromFileMethod – I read an article that wasn’t very specific but said “nested parents” cause problems for XSD.exe and xsd2code.

<Section>
<Form id="1"...>
<Control id="12523"..> <--Some have this some don't
  <Property name="Color">Red</Property>
  <Property name="Size">Large</Property>
</Control>
</Form>
<Form id="2"...>
  <Property name="Color">Blue</Property>
  <Property name="Size">Large</Property>
</Form>
<Form id="3"...>
  <Property name="Color">Red</Property>
  <Property name="Size">Small</Property>
</Form>
</Section>

Thank you for any guidance!

  • 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-20T20:02:03+00:00Added an answer on May 20, 2026 at 8:02 pm

    XSLT is the tool for XML transformation.

    As far as your XML goes, in a lot of applications you should replace this:

    <Property name="Color">Red</Property>
    

    with:

    <Color>Red</Color>
    

    Some reasons:

    1. If you want to write a schema that restricts an element’s content in some way (e.g. to one of a list of values), the element must be identifiable by its name; you can’t write one schema for a Property element with a name attribute equals “Color” and another schema for a Property element whose name attribute equals “Size”.

    2. It’s easier to write XPath predicates if your element names are meaningful. For instance, Form[Color = 'Red'] is a lot easier to write (and read) than Form[Property[@name='Color' and .='Red']]

    3. The above is also true if you’re writing Linq queries against the XML, in pretty much the same manner. Compare Element.Descendants("Color") with Element.Descendents("Property").Where(x => x.Attributes["name"] == "Color").

    There are applications where it’s appropriate to have generically-named elements, too; the above argument’s not definitive. But if you’re going to do that, you should have good reasons.

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

Sidebar

Related Questions

I have an XML file and an XML schema in another file and I'd
I have string of date from xml file of such kind: '2010-09-09T22:33:44.OZ' I need
I have an xml file where I need to comment out a whole piece
i have a log file which contains hundreds/thousands of seperate XML messages and need
I have a 2.4 MB XML file, an export from Microsoft Project (hey I'm
I have an XML file that looks like this. <Almond> Roasted Almonds,Almond Extract,Almond Sauce,Almond
I have one XML file where values are stored in category element separated by
I have an XML file that starts like this: <Elements name=Entities xmlns=XS-GenerationToolElements> I'll have
I have an xml file providing data for a datagrid in Flex 2 that
I have an XML file, which I open in F# like this: let Bookmarks(xmlFile:string)

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.