mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
Ignore whitespace when reading serialized XML objects.
This was previously effectively being done by XmlDocument in the multiple passes through the XML. This change tells XmlReader to ignore whitespace. This also means changing arguments to use XmlReader instead of XmlTextReader (a descendent of XmlReader) directly. XmlReader.Create() has been the recommend way to create XML readers since .NET 2.0 as per MS SDK and is the only way to specific ignore whitespace settings.
This commit is contained in:
@@ -2605,7 +2605,7 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
#region Xml Serialization Utilities
|
||||
public static bool ReadBoolean(XmlTextReader reader)
|
||||
public static bool ReadBoolean(XmlReader reader)
|
||||
{
|
||||
// AuroraSim uses "int" for some fields that are boolean in OpenSim, e.g. "PassCollisions". Don't fail because of this.
|
||||
reader.ReadStartElement();
|
||||
@@ -2616,7 +2616,7 @@ namespace OpenSim.Framework
|
||||
return result;
|
||||
}
|
||||
|
||||
public static UUID ReadUUID(XmlTextReader reader, string name)
|
||||
public static UUID ReadUUID(XmlReader reader, string name)
|
||||
{
|
||||
UUID id;
|
||||
string idStr;
|
||||
@@ -2635,7 +2635,7 @@ namespace OpenSim.Framework
|
||||
return id;
|
||||
}
|
||||
|
||||
public static Vector3 ReadVector(XmlTextReader reader, string name)
|
||||
public static Vector3 ReadVector(XmlReader reader, string name)
|
||||
{
|
||||
Vector3 vec;
|
||||
|
||||
@@ -2648,7 +2648,7 @@ namespace OpenSim.Framework
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Quaternion ReadQuaternion(XmlTextReader reader, string name)
|
||||
public static Quaternion ReadQuaternion(XmlReader reader, string name)
|
||||
{
|
||||
Quaternion quat = new Quaternion();
|
||||
|
||||
@@ -2677,7 +2677,7 @@ namespace OpenSim.Framework
|
||||
return quat;
|
||||
}
|
||||
|
||||
public static T ReadEnum<T>(XmlTextReader reader, string name)
|
||||
public static T ReadEnum<T>(XmlReader reader, string name)
|
||||
{
|
||||
string value = reader.ReadElementContentAsString(name, String.Empty);
|
||||
// !!!!! to deal with flags without commas
|
||||
|
||||
Reference in New Issue
Block a user