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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:28:25+00:00 2026-05-24T06:28:25+00:00

My problem is to output a list in C++ using XmlWriter. I need a

  • 0

My problem is to output a list in C++ using XmlWriter. I need a list wich can be included in my XML file. My planned code – A class should be implemented to generate the list elements, but I don’t know why:

writer->WriteStartElement( "Parameters" );

    writer->WriteStartElement( "ParamterList" );
               // A list including approximately 100 entries
               writer->WriteAttributeString( "ID", "001" );
               writer->WriteAttributeString( "Name", "Dummy1" );
               writer->WriteAttributeString( "BitOffset", "0" );
    writer->WriteEndElement();

writer->WriteEndElement();

How is it possible to insert a list into my application. My output should look like this:

<root Name="database" Purpose="test" Project="test">
<Description Version="1.1B" Author="name">test</Description>
<ContainerList>
    <Container Name="Dummy1" BitOffset="0" />
</ContainerList>
<ParameterList>
    <Paramter ID="001" Name="Dummy1" BitOffset="0" />
    <Paramter ID="002" Name="Dummy2" BitOffset="1" />
    <Paramter ID="003" Name="Dummy3" BitOffset="0" />
    <Paramter ID="004" Name="Dummy4" BitOffset="0" />
     ......
</ParameterList>

Due to the code shown in answer 1, I now know how to use a list with XmlWriter, but at the moment I don’t really know how to connect and write a class for this code?

  • 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-24T06:28:26+00:00Added an answer on May 24, 2026 at 6:28 am

    Each Paramter (did you spell that correctly?) element is an XML element. Therefore, it needs a WriteStartElement call and a WriteEndElement. Within those call, you add your IDs and other attributes. So your list would be something like this:

    for (auto listElement :list) //Using C++0x syntax
    {
      writer->WriteStartElement( "Paramter" );
      writer->WriteAttributeString( "ID", listElement.id() );
      writer->WriteAttributeString( "Name", listElement.name() );
      writer->WriteAttributeString( "BitOffset", listElement.bitOffset() );
      writer->WriteEndElement();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found a problem with the XML Serialization of C#. The output of the
I got a problem in using listfind() . I have a list of strings.One
I face a problem in using AbstractTableModel, i use linked list as a container
I am having a problem with formatting the output from foreach loop. What should
I'm using Stroustrup's swan book. I have run into a problem getting output from
Problem: I need to output the TOP X Contributors determined by the amount of
I'm having a problem using CSS's display:inline property with the list-style-image: property on <li>
using MySQL I need to fill a column with the position in the list
So, I'm having a problem building a feed-style list of posts efficiently using PHP
PROBLEM: In my Program, when I try to loop the entire List of file

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.