문제

I have this XML, and i need deserialize but type is incorrect.

<Consumer>
  <Sex type="int">Man</Sex>
</Consumer>

How could i fix out? I like to allow int and string.

Thx in advance,

도움이 되었습니까?

해결책

The only way you are going to accomplish this is by manually parsing the XML.

All of the regular tools are going to throw a fit over the fact that "Man" is by no means an integer.

다른 팁

Please doing folowing action. Load your XML into Visual Studio, click the "Infer Schema" button, and run "xsd.exe /c schema.xsd" to generate the classes. xsd.exe is in the tools folder. Then go through the generated code and make adjustments, such as changing shorts to ints where appropriate.

check this link

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top