0

I would like to serialize with System.Xml.Serialization the following XML code. Is there a way to have it inside an object containing the type (typeRef) of this variable (text) defined at runtime ?

<input>    
 <inputExpression typeRef="integer">
   <text>4</text>
 </inputExpression>
</input>

typeref can only be primitives types

I would expect to use the implementation of IXmlSerializable on an "InputExpression" class but I'm blocked at this point.

dincan
  • 99
  • 1
  • 8
  • It sounds like you want to deserialize the xml into a object. Is that right? If so, can you share the class definition of the class you are trying to deserialize to? – Mike Hixson Feb 16 '17 at 05:07
  • Yep exactly, but the class is not defined yet. This class needs to have a property with a type defined at runtime, that is my issue. – dincan Feb 16 '17 at 14:14

0 Answers0