question about xml serilization

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amethyste

    question about xml serilization

    hello,

    This is my sample (simplified):

    public class Binom
    {
    [XmlAttribute("r ange")]
    public string _Value;

    [XmlAttribute("n ame")]
    public string Label;
    }

    public class Property
    {
    [XmlAttribute("n ame")]
    public string propertyName;

    public Binom DefaultAttribut e;
    }


    Property serialize as:

    <Properties name="foo">
    <DefaultAttribu te value="12345678 9" name="range" />
    </Properties >

    Is is possible to get rather:

    <foo range="12345678 9"/>

    or eventualy:

    <Properties name="foo">
    <DefaultAttribu te range="12345678 9" />
    </Properties >

    Just using the default Xml serailization?

    Thank you

    Happy new years
  • Christoph Schittko [MVP]

    #2
    Re: question about xml serilization


    amethyste,

    are you trying to dynamically set the element name based on values in
    your object, i.e. if the propertyName is foo and the label is set to
    range, then the serialized XML is

    <foo range="..." />?

    First, changing the element name is only possible if you have a fixed
    set of element names, but not if propertyName can hold arbitrary
    strings. XML serialization is intended to be used with
    strongly-structured XML data. Therefore it works best if you can express
    the XML format as an XML Schema. You can change the element names either
    based on the type of the serialized object:

    [XmlElement( "foo", typeof(fooType) )]
    [XmlElement( "bar", typeof(barType) )]
    public foobarType propertyName;

    or by using the choice construct [0].

    Second, changing the attribute name dynamically only works based on the
    type of the serialized type via attaching multiple attributes. There is
    no equivalent to the choice construct for attributes.

    If you need to be able to by more dynamic than that you must implement
    IXmlSerializabl e [1].

    HTH,
    Christoph Schittko
    MVP XML




    [0] http://www.topxml.com/xmlserializer/...del_groups.asp
    [1] http://msdn2.microsoft.com/library/fhd7bk0a.aspx
    [color=blue]
    > -----Original Message-----
    > From: amethyste [mailto:anonymou s@discussions.m icrosoft.com]
    > Posted At: Tuesday, December 28, 2004 7:16 AM
    > Posted To: microsoft.publi c.dotnet.xml
    > Conversation: question about xml serilization
    > Subject: question about xml serilization
    >
    > hello,
    >
    > This is my sample (simplified):
    >
    > public class Binom
    > {
    > [XmlAttribute("r ange")]
    > public string _Value;
    >
    > [XmlAttribute("n ame")]
    > public string Label;
    > }
    >
    > public class Property
    > {
    > [XmlAttribute("n ame")]
    > public string propertyName;
    >
    > public Binom DefaultAttribut e;
    > }
    >
    >
    > Property serialize as:
    >
    > <Properties name="foo">
    > <DefaultAttribu te value="12345678 9" name="range" />
    > </Properties >
    >
    > Is is possible to get rather:
    >
    > <foo range="12345678 9"/>
    >
    > or eventualy:
    >
    > <Properties name="foo">
    > <DefaultAttribu te range="12345678 9" />
    > </Properties >
    >
    > Just using the default Xml serailization?
    >
    > Thank you
    >
    > Happy new years[/color]

    Comment

    • amethyste

      #3
      Re: question about xml serilization

      thank you,

      I suspected something like this.
      I'm in the case where IXmlSerializabl e is the solution.

      But IXmlSerializabl e is not officially documented. This
      wories me a little bit.

      [color=blue]
      >-----Original Message-----
      >
      >amethyste,
      >
      >are you trying to dynamically set the element name based[/color]
      on values in[color=blue]
      >your object, i.e. if the propertyName is foo and the[/color]
      label is set to[color=blue]
      >range, then the serialized XML is
      >
      ><foo range="..." />?
      >
      >First, changing the element name is only possible if you[/color]
      have a fixed[color=blue]
      >set of element names, but not if propertyName can hold[/color]
      arbitrary[color=blue]
      >strings. XML serialization is intended to be used with
      >strongly-structured XML data. Therefore it works best if[/color]
      you can express[color=blue]
      >the XML format as an XML Schema. You can change the[/color]
      element names either[color=blue]
      >based on the type of the serialized object:
      >
      >[XmlElement( "foo", typeof(fooType) )]
      >[XmlElement( "bar", typeof(barType) )]
      >public foobarType propertyName;
      >
      >or by using the choice construct [0].
      >
      >Second, changing the attribute name dynamically only[/color]
      works based on the[color=blue]
      >type of the serialized type via attaching multiple[/color]
      attributes. There is[color=blue]
      >no equivalent to the choice construct for attributes.
      >
      >If you need to be able to by more dynamic than that you[/color]
      must implement[color=blue]
      >IXmlSerializab le [1].
      >
      >HTH,
      >Christoph Schittko
      >MVP XML
      >http://weblogs.asp.net/cschittko
      >
      >
      >
      >[0][/color]
      Jogue jogos online gratuitos diretamente no seu navegador, no celular, tablet ou computador em Jogos Rix. Não é necessário download nem cadastro.

      p[color=blue]
      >[1] http://msdn2.microsoft.com/library/fhd7bk0a.aspx
      >[color=green]
      >> -----Original Message-----
      >> From: amethyste[/color][/color]
      [mailto:anonymou s@discussions.m icrosoft.com][color=blue][color=green]
      >> Posted At: Tuesday, December 28, 2004 7:16 AM
      >> Posted To: microsoft.publi c.dotnet.xml
      >> Conversation: question about xml serilization
      >> Subject: question about xml serilization
      >>
      >> hello,
      >>
      >> This is my sample (simplified):
      >>
      >> public class Binom
      >> {
      >> [XmlAttribute("r ange")]
      >> public string _Value;
      >>
      >> [XmlAttribute("n ame")]
      >> public string Label;
      >> }
      >>
      >> public class Property
      >> {
      >> [XmlAttribute("n ame")]
      >> public string propertyName;
      >>
      >> public Binom DefaultAttribut e;
      >> }
      >>
      >>
      >> Property serialize as:
      >>
      >> <Properties name="foo">
      >> <DefaultAttribu te value="12345678 9" name="range" />
      >> </Properties >
      >>
      >> Is is possible to get rather:
      >>
      >> <foo range="12345678 9"/>
      >>
      >> or eventualy:
      >>
      >> <Properties name="foo">
      >> <DefaultAttribu te range="12345678 9" />
      >> </Properties >
      >>
      >> Just using the default Xml serailization?
      >>
      >> Thank you
      >>
      >> Happy new years[/color]
      >
      >.
      >[/color]

      Comment

      • Mujtaba Syed

        #4
        Re: question about xml serilization

        Hi:

        Till .NET 1.1, IXmlSerializabl e was mostly intended for internal (MS) use.
        With 2.0, IXmlSerializabl e is receiving more publicity and programmers will
        be encouraged to use it.
        For info about how to implement IXmlSerializabl e in 1.1:


        Mujtaba.

        "amethyste" <anonymous@disc ussions.microso ft.com> wrote in message
        news:038601c4ed 1b$db33ee10$a60 1280a@phx.gbl.. .[color=blue]
        > thank you,
        >
        > I suspected something like this.
        > I'm in the case where IXmlSerializabl e is the solution.
        >
        > But IXmlSerializabl e is not officially documented. This
        > wories me a little bit.
        >
        >[color=green]
        > >-----Original Message-----
        > >
        > >amethyste,
        > >
        > >are you trying to dynamically set the element name based[/color]
        > on values in[color=green]
        > >your object, i.e. if the propertyName is foo and the[/color]
        > label is set to[color=green]
        > >range, then the serialized XML is
        > >
        > ><foo range="..." />?
        > >
        > >First, changing the element name is only possible if you[/color]
        > have a fixed[color=green]
        > >set of element names, but not if propertyName can hold[/color]
        > arbitrary[color=green]
        > >strings. XML serialization is intended to be used with
        > >strongly-structured XML data. Therefore it works best if[/color]
        > you can express[color=green]
        > >the XML format as an XML Schema. You can change the[/color]
        > element names either[color=green]
        > >based on the type of the serialized object:
        > >
        > >[XmlElement( "foo", typeof(fooType) )]
        > >[XmlElement( "bar", typeof(barType) )]
        > >public foobarType propertyName;
        > >
        > >or by using the choice construct [0].
        > >
        > >Second, changing the attribute name dynamically only[/color]
        > works based on the[color=green]
        > >type of the serialized type via attaching multiple[/color]
        > attributes. There is[color=green]
        > >no equivalent to the choice construct for attributes.
        > >
        > >If you need to be able to by more dynamic than that you[/color]
        > must implement[color=green]
        > >IXmlSerializab le [1].
        > >
        > >HTH,
        > >Christoph Schittko
        > >MVP XML
        > >http://weblogs.asp.net/cschittko
        > >
        > >
        > >
        > >[0][/color]
        > http://www.topxml.com/xmlserializer/...odel_groups.as
        > p[color=green]
        > >[1] http://msdn2.microsoft.com/library/fhd7bk0a.aspx
        > >[color=darkred]
        > >> -----Original Message-----
        > >> From: amethyste[/color][/color]
        > [mailto:anonymou s@discussions.m icrosoft.com][color=green][color=darkred]
        > >> Posted At: Tuesday, December 28, 2004 7:16 AM
        > >> Posted To: microsoft.publi c.dotnet.xml
        > >> Conversation: question about xml serilization
        > >> Subject: question about xml serilization
        > >>
        > >> hello,
        > >>
        > >> This is my sample (simplified):
        > >>
        > >> public class Binom
        > >> {
        > >> [XmlAttribute("r ange")]
        > >> public string _Value;
        > >>
        > >> [XmlAttribute("n ame")]
        > >> public string Label;
        > >> }
        > >>
        > >> public class Property
        > >> {
        > >> [XmlAttribute("n ame")]
        > >> public string propertyName;
        > >>
        > >> public Binom DefaultAttribut e;
        > >> }
        > >>
        > >>
        > >> Property serialize as:
        > >>
        > >> <Properties name="foo">
        > >> <DefaultAttribu te value="12345678 9" name="range" />
        > >> </Properties >
        > >>
        > >> Is is possible to get rather:
        > >>
        > >> <foo range="12345678 9"/>
        > >>
        > >> or eventualy:
        > >>
        > >> <Properties name="foo">
        > >> <DefaultAttribu te range="12345678 9" />
        > >> </Properties >
        > >>
        > >> Just using the default Xml serailization?
        > >>
        > >> Thank you
        > >>
        > >> Happy new years[/color]
        > >
        > >.
        > >[/color][/color]


        Comment

        • Christoph Schittko [MVP]

          #5
          Re: question about xml serilization

          The .NET 2.0 documentation for IXmlSerializabl e is also already
          available at



          HTH,
          Christoph Schittko
          MVP XML


          [color=blue]
          > -----Original Message-----
          > From: Mujtaba Syed [mailto:mujtaba@ marlabs.com]
          > Posted At: Tuesday, December 28, 2004 3:53 PM
          > Posted To: microsoft.publi c.dotnet.xml
          > Conversation: question about xml serilization
          > Subject: Re: question about xml serilization
          >
          > Hi:
          >
          > Till .NET 1.1, IXmlSerializabl e was mostly intended for internal (MS)[/color]
          use.[color=blue]
          > With 2.0, IXmlSerializabl e is receiving more publicity and programmers
          > will
          > be encouraged to use it.
          > For info about how to implement IXmlSerializabl e in 1.1:
          > http://dotnetified.com/PermaLink.asp...A95-49B6-909F-
          > CDA36ACF481F
          >
          > Mujtaba.
          >
          > "amethyste" <anonymous@disc ussions.microso ft.com> wrote in message
          > news:038601c4ed 1b$db33ee10$a60 1280a@phx.gbl.. .[color=green]
          > > thank you,
          > >
          > > I suspected something like this.
          > > I'm in the case where IXmlSerializabl e is the solution.
          > >
          > > But IXmlSerializabl e is not officially documented. This
          > > wories me a little bit.
          > >
          > >[color=darkred]
          > > >-----Original Message-----
          > > >
          > > >amethyste,
          > > >
          > > >are you trying to dynamically set the element name based[/color]
          > > on values in[color=darkred]
          > > >your object, i.e. if the propertyName is foo and the[/color]
          > > label is set to[color=darkred]
          > > >range, then the serialized XML is
          > > >
          > > ><foo range="..." />?
          > > >
          > > >First, changing the element name is only possible if you[/color]
          > > have a fixed[color=darkred]
          > > >set of element names, but not if propertyName can hold[/color]
          > > arbitrary[color=darkred]
          > > >strings. XML serialization is intended to be used with
          > > >strongly-structured XML data. Therefore it works best if[/color]
          > > you can express[color=darkred]
          > > >the XML format as an XML Schema. You can change the[/color]
          > > element names either[color=darkred]
          > > >based on the type of the serialized object:
          > > >
          > > >[XmlElement( "foo", typeof(fooType) )]
          > > >[XmlElement( "bar", typeof(barType) )]
          > > >public foobarType propertyName;
          > > >
          > > >or by using the choice construct [0].
          > > >
          > > >Second, changing the attribute name dynamically only[/color]
          > > works based on the[color=darkred]
          > > >type of the serialized type via attaching multiple[/color]
          > > attributes. There is[color=darkred]
          > > >no equivalent to the choice construct for attributes.
          > > >
          > > >If you need to be able to by more dynamic than that you[/color]
          > > must implement[color=darkred]
          > > >IXmlSerializab le [1].
          > > >
          > > >HTH,
          > > >Christoph Schittko
          > > >MVP XML
          > > >http://weblogs.asp.net/cschittko
          > > >
          > > >
          > > >
          > > >[0][/color]
          > > http://www.topxml.com/xmlserializer/...odel_groups.as
          > > p[color=darkred]
          > > >[1] http://msdn2.microsoft.com/library/fhd7bk0a.aspx
          > > >
          > > >> -----Original Message-----
          > > >> From: amethyste[/color]
          > > [mailto:anonymou s@discussions.m icrosoft.com][color=darkred]
          > > >> Posted At: Tuesday, December 28, 2004 7:16 AM
          > > >> Posted To: microsoft.publi c.dotnet.xml
          > > >> Conversation: question about xml serilization
          > > >> Subject: question about xml serilization
          > > >>
          > > >> hello,
          > > >>
          > > >> This is my sample (simplified):
          > > >>
          > > >> public class Binom
          > > >> {
          > > >> [XmlAttribute("r ange")]
          > > >> public string _Value;
          > > >>
          > > >> [XmlAttribute("n ame")]
          > > >> public string Label;
          > > >> }
          > > >>
          > > >> public class Property
          > > >> {
          > > >> [XmlAttribute("n ame")]
          > > >> public string propertyName;
          > > >>
          > > >> public Binom DefaultAttribut e;
          > > >> }
          > > >>
          > > >>
          > > >> Property serialize as:
          > > >>
          > > >> <Properties name="foo">
          > > >> <DefaultAttribu te value="12345678 9" name="range" />
          > > >> </Properties >
          > > >>
          > > >> Is is possible to get rather:
          > > >>
          > > >> <foo range="12345678 9"/>
          > > >>
          > > >> or eventualy:
          > > >>
          > > >> <Properties name="foo">
          > > >> <DefaultAttribu te range="12345678 9" />
          > > >> </Properties >
          > > >>
          > > >> Just using the default Xml serailization?
          > > >>
          > > >> Thank you
          > > >>
          > > >> Happy new years
          > > >
          > > >.
          > > >[/color][/color][/color]


          Comment

          • amethyste

            #6
            Re: question about xml serilization

            IXmlSerializabl e is still for internal use in vs 2005
            béta, but this time MS gives samples!
            I don't understand this anyway, why not fully document
            this interface? It's just an interface after all and
            runtime serialization has a full support for
            customization already.

            thank you
            Amethyste
            [color=blue]
            >-----Original Message-----
            >Hi:
            >
            >Till .NET 1.1, IXmlSerializabl e was mostly intended for [/color]
            internal (MS) use.[color=blue]
            >With 2.0, IXmlSerializabl e is receiving more publicity [/color]
            and programmers will[color=blue]
            >be encouraged to use it.
            >For info about how to implement IXmlSerializabl e in 1.1:
            >http://dotnetified.com/PermaLink.asp...E86B447E-AA95-[/color]
            49B6-909F-CDA36ACF481F[color=blue]
            >
            >Mujtaba.
            >
            >"amethyste" <anonymous@disc ussions.microso ft.com> wrote [/color]
            in message[color=blue]
            >news:038601c4e d1b$db33ee10$a6 01280a@phx.gbl. ..[color=green]
            >> thank you,
            >>
            >> I suspected something like this.
            >> I'm in the case where IXmlSerializabl e is the solution.
            >>
            >> But IXmlSerializabl e is not officially documented. This
            >> wories me a little bit.
            >>
            >>[color=darkred]
            >> >-----Original Message-----
            >> >
            >> >amethyste,
            >> >
            >> >are you trying to dynamically set the element name [/color][/color][/color]
            based[color=blue][color=green]
            >> on values in[color=darkred]
            >> >your object, i.e. if the propertyName is foo and the[/color]
            >> label is set to[color=darkred]
            >> >range, then the serialized XML is
            >> >
            >> ><foo range="..." />?
            >> >
            >> >First, changing the element name is only possible if [/color][/color][/color]
            you[color=blue][color=green]
            >> have a fixed[color=darkred]
            >> >set of element names, but not if propertyName can hold[/color]
            >> arbitrary[color=darkred]
            >> >strings. XML serialization is intended to be used with
            >> >strongly-structured XML data. Therefore it works best [/color][/color][/color]
            if[color=blue][color=green]
            >> you can express[color=darkred]
            >> >the XML format as an XML Schema. You can change the[/color]
            >> element names either[color=darkred]
            >> >based on the type of the serialized object:
            >> >
            >> >[XmlElement( "foo", typeof(fooType) )]
            >> >[XmlElement( "bar", typeof(barType) )]
            >> >public foobarType propertyName;
            >> >
            >> >or by using the choice construct [0].
            >> >
            >> >Second, changing the attribute name dynamically only[/color]
            >> works based on the[color=darkred]
            >> >type of the serialized type via attaching multiple[/color]
            >> attributes. There is[color=darkred]
            >> >no equivalent to the choice construct for attributes.
            >> >
            >> >If you need to be able to by more dynamic than that [/color][/color][/color]
            you[color=blue][color=green]
            >> must implement[color=darkred]
            >> >IXmlSerializab le [1].
            >> >
            >> >HTH,
            >> >Christoph Schittko
            >> >MVP XML
            >> >http://weblogs.asp.net/cschittko
            >> >
            >> >
            >> >
            >> >[0][/color]
            >> [/color][/color]
            http://www.topxml.com/xmlserializer/...odel_groups.as[color=blue][color=green]
            >> p[color=darkred]
            >> >[1] http://msdn2.microsoft.com/library/fhd7bk0a.aspx
            >> >
            >> >> -----Original Message-----
            >> >> From: amethyste[/color]
            >> [mailto:anonymou s@discussions.m icrosoft.com][color=darkred]
            >> >> Posted At: Tuesday, December 28, 2004 7:16 AM
            >> >> Posted To: microsoft.publi c.dotnet.xml
            >> >> Conversation: question about xml serilization
            >> >> Subject: question about xml serilization
            >> >>
            >> >> hello,
            >> >>
            >> >> This is my sample (simplified):
            >> >>
            >> >> public class Binom
            >> >> {
            >> >> [XmlAttribute("r ange")]
            >> >> public string _Value;
            >> >>
            >> >> [XmlAttribute("n ame")]
            >> >> public string Label;
            >> >> }
            >> >>
            >> >> public class Property
            >> >> {
            >> >> [XmlAttribute("n ame")]
            >> >> public string propertyName;
            >> >>
            >> >> public Binom DefaultAttribut e;
            >> >> }
            >> >>
            >> >>
            >> >> Property serialize as:
            >> >>
            >> >> <Properties name="foo">
            >> >> <DefaultAttribu te value="12345678 9" name="range" />
            >> >> </Properties >
            >> >>
            >> >> Is is possible to get rather:
            >> >>
            >> >> <foo range="12345678 9"/>
            >> >>
            >> >> or eventualy:
            >> >>
            >> >> <Properties name="foo">
            >> >> <DefaultAttribu te range="12345678 9" />
            >> >> </Properties >
            >> >>
            >> >> Just using the default Xml serailization?
            >> >>
            >> >> Thank you
            >> >>
            >> >> Happy new years
            >> >
            >> >.
            >> >[/color][/color]
            >
            >
            >.
            >[/color]

            Comment

            • Mujtaba Syed

              #7
              Re: question about xml serilization

              It is not recommeded to use the GetSchema method of IXmlSerialiazab le 2.0.
              Instead a new attribute called [XmlSchemaProvid er] is available to indicate
              a static method of the type that will provide the schema.



              Mujtaba.

              "Christoph Schittko [MVP]" <INVALIDEMAIL@a ustin.rr.com> wrote in message
              news:%23WkklRV7 EHA.3700@tk2msf tngp13.phx.gbl. ..[color=blue]
              > The .NET 2.0 documentation for IXmlSerializabl e is also already
              > available at
              >
              > http://msdn2.microsoft.com/library/fhd7bk0a.aspx
              >
              > HTH,
              > Christoph Schittko
              > MVP XML
              > http://weblogs.asp.net/cschittko
              >
              >[color=green]
              > > -----Original Message-----
              > > From: Mujtaba Syed [mailto:mujtaba@ marlabs.com]
              > > Posted At: Tuesday, December 28, 2004 3:53 PM
              > > Posted To: microsoft.publi c.dotnet.xml
              > > Conversation: question about xml serilization
              > > Subject: Re: question about xml serilization
              > >
              > > Hi:
              > >
              > > Till .NET 1.1, IXmlSerializabl e was mostly intended for internal (MS)[/color]
              > use.[color=green]
              > > With 2.0, IXmlSerializabl e is receiving more publicity and programmers
              > > will
              > > be encouraged to use it.
              > > For info about how to implement IXmlSerializabl e in 1.1:
              > > http://dotnetified.com/PermaLink.asp...A95-49B6-909F-
              > > CDA36ACF481F
              > >
              > > Mujtaba.
              > >
              > > "amethyste" <anonymous@disc ussions.microso ft.com> wrote in message
              > > news:038601c4ed 1b$db33ee10$a60 1280a@phx.gbl.. .[color=darkred]
              > > > thank you,
              > > >
              > > > I suspected something like this.
              > > > I'm in the case where IXmlSerializabl e is the solution.
              > > >
              > > > But IXmlSerializabl e is not officially documented. This
              > > > wories me a little bit.
              > > >
              > > >
              > > > >-----Original Message-----
              > > > >
              > > > >amethyste,
              > > > >
              > > > >are you trying to dynamically set the element name based
              > > > on values in
              > > > >your object, i.e. if the propertyName is foo and the
              > > > label is set to
              > > > >range, then the serialized XML is
              > > > >
              > > > ><foo range="..." />?
              > > > >
              > > > >First, changing the element name is only possible if you
              > > > have a fixed
              > > > >set of element names, but not if propertyName can hold
              > > > arbitrary
              > > > >strings. XML serialization is intended to be used with
              > > > >strongly-structured XML data. Therefore it works best if
              > > > you can express
              > > > >the XML format as an XML Schema. You can change the
              > > > element names either
              > > > >based on the type of the serialized object:
              > > > >
              > > > >[XmlElement( "foo", typeof(fooType) )]
              > > > >[XmlElement( "bar", typeof(barType) )]
              > > > >public foobarType propertyName;
              > > > >
              > > > >or by using the choice construct [0].
              > > > >
              > > > >Second, changing the attribute name dynamically only
              > > > works based on the
              > > > >type of the serialized type via attaching multiple
              > > > attributes. There is
              > > > >no equivalent to the choice construct for attributes.
              > > > >
              > > > >If you need to be able to by more dynamic than that you
              > > > must implement
              > > > >IXmlSerializab le [1].
              > > > >
              > > > >HTH,
              > > > >Christoph Schittko
              > > > >MVP XML
              > > > >http://weblogs.asp.net/cschittko
              > > > >
              > > > >
              > > > >
              > > > >[0]
              > > > http://www.topxml.com/xmlserializer/...odel_groups.as
              > > > p
              > > > >[1] http://msdn2.microsoft.com/library/fhd7bk0a.aspx
              > > > >
              > > > >> -----Original Message-----
              > > > >> From: amethyste
              > > > [mailto:anonymou s@discussions.m icrosoft.com]
              > > > >> Posted At: Tuesday, December 28, 2004 7:16 AM
              > > > >> Posted To: microsoft.publi c.dotnet.xml
              > > > >> Conversation: question about xml serilization
              > > > >> Subject: question about xml serilization
              > > > >>
              > > > >> hello,
              > > > >>
              > > > >> This is my sample (simplified):
              > > > >>
              > > > >> public class Binom
              > > > >> {
              > > > >> [XmlAttribute("r ange")]
              > > > >> public string _Value;
              > > > >>
              > > > >> [XmlAttribute("n ame")]
              > > > >> public string Label;
              > > > >> }
              > > > >>
              > > > >> public class Property
              > > > >> {
              > > > >> [XmlAttribute("n ame")]
              > > > >> public string propertyName;
              > > > >>
              > > > >> public Binom DefaultAttribut e;
              > > > >> }
              > > > >>
              > > > >>
              > > > >> Property serialize as:
              > > > >>
              > > > >> <Properties name="foo">
              > > > >> <DefaultAttribu te value="12345678 9" name="range" />
              > > > >> </Properties >
              > > > >>
              > > > >> Is is possible to get rather:
              > > > >>
              > > > >> <foo range="12345678 9"/>
              > > > >>
              > > > >> or eventualy:
              > > > >>
              > > > >> <Properties name="foo">
              > > > >> <DefaultAttribu te range="12345678 9" />
              > > > >> </Properties >
              > > > >>
              > > > >> Just using the default Xml serailization?
              > > > >>
              > > > >> Thank you
              > > > >>
              > > > >> Happy new years
              > > > >
              > > > >.
              > > > >[/color][/color]
              >
              >[/color]


              Comment

              Working...