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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:53:45+00:00 2026-05-13T19:53:45+00:00

I need to know how the XML class for the serialization should look like:

  • 0

I need to know how the XML class for the serialization should look like:

I need this XML

<?xml version="1.0" encoding="UTF-8"?>
<import date="2010-02-12T23:33:39">
  <T_Employee>
    <MI_KZ>HKBZV</MI_KZ>
    <MI_Name>John</MI_Name>
    <MI_Vorname>Doe</MI_Vorname>
    <MI_Nummer>987654321</MI_Nummer>
    <MI_DatumVon>2010-02-11T10:45:37</MI_DatumVon>
        <MI_DatumBis>2010-03-13T00:00:00</MI_DatumBis>
    <AP_Bezeichnung>5-B-03</AP_Bezeichnung>
    <KOE_Code>FHBM</KOE_Code>
    <KST_Code></KST_Code>
    <KST_Kurz><![CDATA[]]></KST_Kurz>
      </T_Employee>
  <T_Employee>
    <MI_KZ>EX2FC</MI_KZ>
    <MI_Name>Doe</MI_Name>
    <MI_Vorname>Johnny</MI_Vorname>
    <MI_Nummer>123456789</MI_Nummer>
    <MI_DatumVon>2010-01-13T05:52:16</MI_DatumVon>
    <MI_DatumBis>2010-02-01T23:00:00</MI_DatumBis>
    <AP_Bezeichnung>Test1</AP_Bezeichnung>
    <KOE_Code>Test2</KOE_Code>
    <KST_Code>Test3</KST_Code>
    <KST_Kurz>Test4</KST_Kurz>
  </T_Employee>

</import>

But so far, I got that

<?xml version="1.0" encoding="utf-8"?>
<import date="2010-02-12T23:33:39">
  <T_Employee>
    <cEmployee>
      <MI_KZ />
      <MI_Name>Doe</MI_Name>
          <MI_Vorname>John</MI_Vorname>
      <MI_Nummer />
      <MI_DatumVon />
      <MI_DatumBis />
      <AP_Bezeichnung />
      <KOE_Code>abc</KOE_Code>
      <KST_Code />
      <KST_Kurz />
    </cEmployee>
    <cEmployee>
      <MI_KZ />
      <MI_Name>Doe</MI_Name>
      <MI_Vorname>Johnny</MI_Vorname>
      <MI_Nummer />
      <MI_DatumVon />
      <MI_DatumBis />
      <AP_Bezeichnung />
      <KOE_Code>def</KOE_Code>
      <KST_Code />
      <KST_Kurz />
    </cEmployee>
  </T_Employee>
</import>

using this VB.NET class

 Public Class cEmployee
    <System.Xml.Serialization.XmlElement("MI_KZ")> _
    Public strMI_KZ As String = ""

    <System.Xml.Serialization.XmlElement("MI_Name")> _
    Public strMI_Name As String = ""

    <System.Xml.Serialization.XmlElement("MI_Vorname")> _
    Public strMI_Vorname As String = ""

    <System.Xml.Serialization.XmlElement("MI_Nummer")> _
    Public strMI_Nummer As String = ""

    <System.Xml.Serialization.XmlElement("MI_DatumVon")> _
    Public strMI_DatumVon As String = ""

    <System.Xml.Serialization.XmlElement("MI_DatumBis")> _
    Public strMI_DatumBis As String = ""

    <System.Xml.Serialization.XmlElement("AP_Bezeichnung")> _
    Public strAP_Bezeichnung As String = ""

    <System.Xml.Serialization.XmlElement("KOE_Code")> _
    Public strKOE_Code As String = ""

    <System.Xml.Serialization.XmlElement("KST_Code")> _
    Public strKST_Code As String = ""

    <System.Xml.Serialization.XmlElement("KST_Kurz")> _
    Public strKST_Kurz As String = ""
End Class


<System.Xml.Serialization.XmlRoot("import")> _
Public Class cImportXML
    <System.Xml.Serialization.XmlAttribute("date")> _
    Public generated As String = ""



    <System.Xml.Serialization.XmlArray("T_Employee")> _
    Public Mitarbeiter As List(Of cEmployee) = New List(Of cEmployee)

End Class
  • 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-13T19:53:46+00:00Added an answer on May 13, 2026 at 7:53 pm

    One trick here is xsd.exe:

    xsd.exe sample.xml
    xsd.exe sample.xsd /classes /language:VB
    

    This should generate compatible classes for you. However, the specific problem in this case is that you want [XmlElement], not [XmlArray]:

    <System.Xml.Serialization.XmlElementAttribute("T_Employee")> _
    Public HelsanaMitarbeiter As List(Of cEmployee) = New List(Of cEmployee)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Why XML-Serializable class need a parameterless constructor Does anyone know if it
I need to know how the performance of different XML tools (parsers, validators, XPath
I know how to find what I need from XML using XPath. The syntax
I need to know about Epoll On linux System. Could you recommend manual or
I need to know how much space occupies all the databases inside an SQL
I need to know how to turn on Code Coverage when running TFS builds
I need to know when the memory will be allocated for a particular program.
I need to know, from within Powershell, if the current drive is a mapped
I need to know how I get the stream of the headers and footers
I need to know what internet connection is available when my application is running.

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.