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. XML / XSL
  4. Xml Attibute in C#

Xml Attibute in C#

Scheduled Pinned Locked Moved XML / XSL
csharpxmljsonquestion
1 Posts 1 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.
  • M Offline
    M Offline
    manustone
    wrote on last edited by
    #1

    HI am trying to Serialize( cos requested by application ) a class using XML Attributes. Xml file should be like the one written below. I tried using XML Serialization Attributes but I cannot find any solution. The fact is that for each item name is an attribute for the class variable, but I am not able to put the value without adding an extra tag. Have you some idea about that? OUPUT on FILE expected <MyData> <variable name="FirstVar">value <variable name="FirstVar">value1</variable> <variable name="SecondVar">value2</variable> <variable name="ThirdVar">value3</variable> </MyData> MY CLASS that doesn't work class variable { [XmlAttribute] String name; } class MyData { [XmlElement] variable[] list; }

    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