Is there a possibility to use xmlwriter (xmlserialization) without managed code (cli)?
using namespace System::Xml;
using namespace System::Xml::Schema;
using namespace System::Xml::Serialization;
My XML serialization managed code:
void TXML_Interface::LoadXML( String^ filename )
{
XmlSerializer^ serializer = gcnew XmlSerializer( TTEST::typeid );
FileStream^ fs = gcnew FileStream( filename,FileMode::Open );
XmlReader^ reader = gcnew XmlTextReader( fs );
m_test = dynamic_cast<TTEST^>(serializer->Deserialize( reader ));
}
Yes and no.
Yes it is possible to do XML maniuplation (including serialisation) without managed code – I’d normally do this using MSXML however there are various ways to perform xml serialisation in C++ (I’m not really a C++ person but Google is almost certainly the first place to look).
However this is using a different mechanism from the ones contained in the
System.Xml.Serializationnamespace. Unfortunately for you the Xml serialisation in .Net is all implemented in managed code, and so if you want to use it you will need to call into managed code (e.g. by using the/clrcompiler option or COM interop).