Game Development Reference
In-Depth Information
"{../../usos:Row[1]/usos:Cell[ ￿ cellPos]/usos:Data}">
<xsl:value-of select="usos:Data" />
</xsl:element>
</xsl:for-each>
</CharacterData>
</xsl:if>
</xsl:for-each>
</Characters>
</xsl:template>
</xsl:stylesheet>
Listing 12.14. Updated XSL transform document (library.xsl).
With this new XSL document, we simply regenerate the library.xml document
using xslt.exe library.xsl CharacterData.xml library.xml . t, r n
library-driver library.xml from the generated example directory and voila!
You'll notice, too, that if you run the newly generated XML through our existing
C# autoxml application that it still deserializes properly. We now have serialized
object portability between C# and C++!
12.4.4 XML Data Binding Limitations
Most documentation available online for XML data binding will include the lim-
itations to serializing objects via XML. Even in MSDN 's introduction to XML
serialization there is a section entitled “XML Serialization Considerations.” For
completeness, I'll include some of the common limitations:
Private properties and fields cannot be serialized.
Methods cannot be serialized.
Serialized classes must have a default constructor.
Comments and processing instructions are not preserved.
Circular references are not supported.
Generic Dictionary and List fields are not supported.
For some of these limitations, such as generics support, there are generally good
workarounds that can be had with a simple search query at your favorite search
engine. Usually, when you encounter one of these limitations, you can rework your
classes to accommodate.
Search WWH ::




Custom Search