Hi all,
i'm serializing an arraylist like the following with an "Role" object as
it's item.
-----------------------------------------------------
----[code]
ArrayList ar = new ArrayList();
ar.Add( new Role( "Admin" ) );
ar.Add( new Role( "Test" ) );
StringWriter writer = new StringWriter();
XmlSerializer serializer = new XmlSerializer( typeof( ArrayList), null, new
Type[] { typeof(Role) }, new XmlRootAttribute( "roles" ), null );
serializer.Serialize( writer, ar );
----[result]
<?xml version="1.0" encoding="utf-16"?>
<roles xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<anyType xsi:type="Role" name="Admin" />
<anyType xsi:type="Role" name="Test" />
</roles>
-----------------------------------------------------
is there anyway of getting "<anyType>" to appear as "<role>" ?
the "Role class" has the XmlRootAttribute specified as "role".
thanks,