Giter Club home page Giter Club logo

nserializer's People

Watchers

 avatar

nserializer's Issues

Autoproperties creating non-xml-conform backingfield names "<myAutoProperty>k__BackingField"

What steps will reproduce the problem?
1. Add in "SampleTestFixture.cs" in "MyClassUnderTest" the following
autoproperty: public string MyProperty { get; set; }
2. Run test SampleTestFixture CanSerialize() and watch xmlText

What is the expected output? What do you see instead?
Expected:
<f name="MyProperty">
  <string value="some test content" />
</f>

Instead of
<f name="<MyProperty>k__BackingField">
  <string value="some test content" />
</f>

What version of the product are you using? On what operating system?
r127 or r115 (didn't work either), WinXp VS2010 .NET 4.0

First of all: Good work! 
We've a big dom with lot of dependency injection (ninject) and a lot of
interfaces or interfaces of lists of interfaces that should be serialized
and that's why I checked out your nserializer.
There's one big problem: We just want to serialize properties, because only
properties can be defined on interfaces. Private Fields should not be
serialized in our project. Now I reviewed your framework and I could not
solve the naming problem. If you get the properties with the
type.GetProperties(BindingFlags...), they're named correctly and the
MemberType is Property, but their (invisible) backing field is also read by
type.GetFields(BindingsFlags...). If I set the fields to empty array and
only took the Properties, there was no output...

I'm looking forward to use nserializer in our project. For more information
or contact (skype, email) please contact me on kuermX at gmail

Thanks in advance

Martin

Original issue reported on code.google.com by [email protected] on 12 Mar 2010 at 9:58

.NET 2.0 support

Nice tool. Unfortunately i am using .NET 2.0. Possible to get the older version 
source codes?

Original issue reported on code.google.com by [email protected] on 26 Aug 2010 at 5:56

Special characters are not decoded/encoded

What steps will reproduce the problem?
1. Serialize a value with special characters like "<", "&", """, ...

What is the expected output? What do you see instead?
For "&" I expect "&amp;" etc
Instead of an xml error when loading the string in a xml document

What version of the product are you using? On what operating system?
r115, XP, .NET 4

Please provide any additional information below.
To Fix reading, just rewrite NullFieldDefinition.cs
public object Convert(object value)
{
    return value;
}
to
public object Convert(object value)
{
    if (value.GetType() == typeof(string))
    {
        value = HttpUtility.HtmlDecode(value.ToString());
    }

    return value;
}

In my opinion value should always be a string object. But I didn't wrote
the framework... maybe the if is not needed

To Fix writing, just rewrite NXmlNodeWriter.cs
public void AddAttribute(string attributeName, string value)
{
    if (streamWriter != null)
    {
        streamWriter.Write(string.Format(" {0}=\"{1}\"", attributeName,
value));
    }
}
to
public void AddAttribute(string attributeName, string value)
{
    if (streamWriter != null)
    {
        value = HttpUtility.HtmlEncode(value);
        streamWriter.Write(string.Format(" {0}=\"{1}\"", attributeName,
value));
    }
}

Original issue reported on code.google.com by [email protected] on 12 Mar 2010 at 3:10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.