xml serialization for white space code

V

virendra.chandra

hey, anybody help me.
my problem is that i am doing xml seriazation through top most class.
so many place i need indentation. so what i did i put hexadecimal
code(   )

class sample
{
private string _title;
public string Title
{
get
{
return _title;
}
set
{
_title=value;
}
}
}

i assign Title = "   Book Shop Inventory";

but in time of serialization i am getting like that.
<Title>"&amp;#xA0;&amp;#xA0;&amp;#xA0;Book Shop Inventory</Title>
how i can overcome of this problem. is there any other way to get white
space. if pdf generation.
if i am simpley ptting a empty space then also i am getting same after
xml serialization.
but converting it into pdf. simply this empty space is not coming. so
what can i do.

Title = " Book Shop Inventory";

<Title> Book Shop Inventory</Title>

thanks in advance
 
J

Jon Skeet [C# MVP]

virendra.chandra said:
hey, anybody help me.
my problem is that i am doing xml seriazation through top most class.
so many place i need indentation. so what i did i put hexadecimal
code(   )

<snip>

It's not entirely obvious what you're doing, or where the problem is.
Could you write a short but complete program the demonstrates the
problem? I suspect you just need to have a class to serialize, and a
main program which sets some properties, serializes, deserializes, and
then displays the properties.

See http://www.pobox.com/~skeet/csharp/complete.html for more
information on what I'm after.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top