J
jamie
OK I'm not sure how explain this without giving hundreds of lines of code.
basically I have a main class that I want to serialize. It's constructor
creates more classes that I also want serialized.
public Mainclass{
public subclass1 class1;
public MainClass()
{
class1 = new subclass1()
}
}
//Now that subclass wants to create more classes
public subclass1 {
public string blah;
public subclass2[] class2array;
public subclass1()
{
blah = "blah";
class2array = new class2array[2]
for (int i =0; i<2; i++)
{
class2array = new subclass2(i.ToString());
}
}
}
//which creates
public subclass2{
public string name;
public subclass2(string inName)
{
name = in Name;
}
public subclass2()
{
// default constructor
}
}
Now when I serialize this thing I'd hope I get back something like
<?xml version="1.0" encoding="utf-8"?>
<MainClass xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001...>
<subClass1>
<blah>blah</blah>
<subclass2>
<name>0</name>
</subclass2>
<subclass2>
<name>1</name>
</subclass2>
</subClass1>
</MainClass >
Running this in the regular framework I do get that back However running
this in the compact framework I get back
<MainClass xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001...>
<subClass1>
<blah>blah</blah>
</subClass1>
</MainClass >
The difference seems to be coming from within the loops but I can't see what
Is going wrong there. Is this a known thing? I didn't post my actual code
since it's miles long but this is the general idea of what is failing. If
I throw in a debug message in the constructor for subClass2 It does fire
so it is getting all the way down there it's just not showing up in the XML
at the end.
Any idea?
sorry for the cross post but the XML guys seem to not answer many CF
questions.
basically I have a main class that I want to serialize. It's constructor
creates more classes that I also want serialized.
public Mainclass{
public subclass1 class1;
public MainClass()
{
class1 = new subclass1()
}
}
//Now that subclass wants to create more classes
public subclass1 {
public string blah;
public subclass2[] class2array;
public subclass1()
{
blah = "blah";
class2array = new class2array[2]
for (int i =0; i<2; i++)
{
class2array = new subclass2(i.ToString());
}
}
}
//which creates
public subclass2{
public string name;
public subclass2(string inName)
{
name = in Name;
}
public subclass2()
{
// default constructor
}
}
Now when I serialize this thing I'd hope I get back something like
<?xml version="1.0" encoding="utf-8"?>
<MainClass xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001...>
<subClass1>
<blah>blah</blah>
<subclass2>
<name>0</name>
</subclass2>
<subclass2>
<name>1</name>
</subclass2>
</subClass1>
</MainClass >
Running this in the regular framework I do get that back However running
this in the compact framework I get back
<MainClass xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001...>
<subClass1>
<blah>blah</blah>
</subClass1>
</MainClass >
The difference seems to be coming from within the loops but I can't see what
Is going wrong there. Is this a known thing? I didn't post my actual code
since it's miles long but this is the general idea of what is failing. If
I throw in a debug message in the constructor for subClass2 It does fire
so it is getting all the way down there it's just not showing up in the XML
at the end.
Any idea?
sorry for the cross post but the XML guys seem to not answer many CF
questions.