tags:

views:

61

answers:

1
+2  Q: 

Class from Schema

I have used the xsd.exe tool to generate a class from a schema, when de-serialising a valid XML document then I get exceptions.

Example xml is here : http://codepaste.net/wq22hy

Class definition is here : http://codepaste.net/bdy598

The problem is at the element, in that the class definition does not seem to handle the recursive nature of this element.

Within a element, its children can be either another or a element - the generated class does not seem to cater for this.

Any help on how I can fix this.

A: 

Oops - a bit of a schoolboy error. The class used for the de-serialisation was generated from the wrong schema file. The schema file used did not have the recursion within it and hence it was not instantiated within the generated class.

BENBUN Coder