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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:28:07+00:00 2026-06-13T07:28:07+00:00

So I am making this class in vb.net. This class will be serialized into

  • 0

So I am making this class in vb.net. This class will be serialized into a xml.

by using

< XmlElement(“Cookies”)> _

I can name the elements the way I want it to be.

  Private i_cookies As Integer
<XmlElement("Cookies")> _
Public Property Cookies() As Integer
    Get
        Return i_cookies 
    End Get
    Set(ByVal value As Integer)
        i_cookies = value
    End Set
End Property

The elements are easy to name. But the thing is that i now need to do something to make a sequence containing the elements and complextype containing the sequence and also name them appropriately.

Does anyone know how to do this ?

I keep thinking that I need to put my properties(which are the elements) into something(but I don’t know what) to represent as sequence and the sequence into something that represents as complextype.

Edit: I really have no idea how to formulate my question properly.

Edit(More information requested):
Below is the information on the way i want it to be, but the problem is that, i dont know how to add complextype and the sequence around the element and within the root in my class.

<root>
 <complexType name ="ShoppingList">
   <sequence>
     <element name="cookies"></element>
     ''More elements/product and such, but this isn't that difficult
   </sequence>
 </complexType>
<root>
  • 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-06-13T07:28:08+00:00Added an answer on June 13, 2026 at 7:28 am

    I’m not sure what the exact structure you are trying to model. Here are some examples:


    <ShoppingList>
        <Cookies>3</Cookies>
    </ShoppingList>
    

    is modeled by

    <XmlType("ShoppingList")> _
    Public Class ShoppingList
        <XmlElement("Cookies")> _
        Public Property Cookies As Integer
    End Class
    

    <ShoppingList>
        <Cookies>
            <Cookie>Chocolate Chip Cookies</Cookie>
            <Cookie>Brownies</Cookie>
        </Cookies>
    </ShoppingList>
    

    is modeled by

    <XmlType("ShoppingList")> _
    Public Class ShoppingList
        <XmlArray("Cookies")> _
        Public Property Cookies As List(Of Cookie)
    End Class
    
    Public Class Cookie
        <XmlText> _
        Public Property Name As String
    End Class
    

    or

    <XmlType("ShoppingList")> _
    Public Class ShoppingList
        <XmlArray("Cookies")> _
        <XmlArrayItem("Cookie")> _
        Public Property Cookies As List(Of String)
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a class library in .NET that other developers will consume eventually. This
I know that making a class static in a ASP.Net project will cause that
Hai. I was making this simple string class and was wondering if there was
I'm making this method retrieve records from the Data Base. As you can see
I am currently in the process of making a snake game using VB.NET... I
This is my first php script. I actually code in vb.net.. I am making
I hope this is ok asking here.. I Have been making an asp.net application
I have a service that attempting to serialize a list into JSON (using JSON.NET)
I'm using VB.NET but this question applies to any OO language - Java, C#
I am making this assignment in my program and I am getting the warning

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.