The XML Schema Part 2 specifies that an instance of a datatype that is defined as boolean can have the following legal literals {true, false, 1, 0}.
The following XML, for example, when deserialized, sets the boolean property "Emulate" to true
.
<root>
<emulate>1</emulate>
</root>
However, when I serialize the object back to the XML, I get true
instead of the numerical value. My question is, is there a way that I can control the boolean representation in the XML?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…