I've a complex problem:
I'm deserializing a very long string of XML into a very large object
foo:
<foo>
.......
<bar>sometime s a simple string is here</bar>
.......
</foo>
or sometimes it's
<foo>
.......
<bar>
<zip>sometime s</zip>
<zap>more structure</zap>
<zoo>is here</zoo>
</bar>
.......
</foo>
the foo class is either foo1
class foo {
....
string bar;
....
}
or foo2
class foo {
...
string bar[];
...
}
class bar {
string zip;
string zap;
string zoo;
}
The short bar element is the only difference between the large foo1 and
foo2.
What is the best (ok, easiest; robust; fastest) way to do this?
1. select the correct type
2. remove the <bar>...</barfrom the string and deserialize separately
3. use XMLAnyElement
4. use the unknown element event
Thanks,
Bill
I'm deserializing a very long string of XML into a very large object
foo:
<foo>
.......
<bar>sometime s a simple string is here</bar>
.......
</foo>
or sometimes it's
<foo>
.......
<bar>
<zip>sometime s</zip>
<zap>more structure</zap>
<zoo>is here</zoo>
</bar>
.......
</foo>
the foo class is either foo1
class foo {
....
string bar;
....
}
or foo2
class foo {
...
string bar[];
...
}
class bar {
string zip;
string zap;
string zoo;
}
The short bar element is the only difference between the large foo1 and
foo2.
What is the best (ok, easiest; robust; fastest) way to do this?
1. select the correct type
2. remove the <bar>...</barfrom the string and deserialize separately
3. use XMLAnyElement
4. use the unknown element event
Thanks,
Bill
Comment