Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. xml serialization

xml serialization

Scheduled Pinned Locked Moved C#
xmljsontutorial
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    brsecu
    wrote on last edited by
    #1

    I gotten to the point where i can serialize an xml document using a class. I just cant figure out how to get a complex type to serialize. How should my class look if i need something like Mary Cummings

    J G B 3 Replies Last reply
    0
    • B brsecu

      I gotten to the point where i can serialize an xml document using a class. I just cant figure out how to get a complex type to serialize. How should my class look if i need something like Mary Cummings

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      I think you'd need several classes for that:

      class Family
      {
         public Mother Mother;
      }

      class Mother
      {
          public Name Name;
      }

      class Name
      {
         public string First = "Mary";
         public string Last = "Cummings";
      }

      If you serialized the Family class, it would result in something like your XML document. Of course, you'll probably want to use properties instead of public fields.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Just F-ing Do It :) The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      1 Reply Last reply
      0
      • B brsecu

        I gotten to the point where i can serialize an xml document using a class. I just cant figure out how to get a complex type to serialize. How should my class look if i need something like Mary Cummings

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #3

        This will help you: http://www.codeproject.com/soap/Serialization.asp

        #region signature my articles #endregion

        1 Reply Last reply
        0
        • B brsecu

          I gotten to the point where i can serialize an xml document using a class. I just cant figure out how to get a complex type to serialize. How should my class look if i need something like Mary Cummings

          B Offline
          B Offline
          BoneSoft
          wrote on last edited by
          #4

          My article might help http://www.codeproject.com/soap/GameCatalog.asp[^] And my software can do it for you. http://www.bonesoft.com/XMLModeler/Demo.aspx[^]


          Try code model generation tools at BoneSoft.com.

          R 1 Reply Last reply
          0
          • B BoneSoft

            My article might help http://www.codeproject.com/soap/GameCatalog.asp[^] And my software can do it for you. http://www.bonesoft.com/XMLModeler/Demo.aspx[^]


            Try code model generation tools at BoneSoft.com.

            R Offline
            R Offline
            Rudolf Jan
            wrote on last edited by
            #5

            Interesting tool at first sight. Does it support inheritance? Rudolf Heijink

            B 1 Reply Last reply
            0
            • R Rudolf Jan

              Interesting tool at first sight. Does it support inheritance? Rudolf Heijink

              B Offline
              B Offline
              BoneSoft
              wrote on last edited by
              #6

              Building through XSD, yes it does. From straight XML there's no way to specify inheritance. Or were you asking about Pseudo code?


              Try code model generation tools at BoneSoft.com.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups