aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-08-29 19:08:23 +0100
committerJustin Clark-Casey (justincc)2014-08-29 19:08:23 +0100
commit1b75ec5647afeb9fbdad78f70c0c90a829bba076 (patch)
tree500744dddfc3f4238391d9e04ca431669f742ce5 /OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
parentFix recent regression test TestDeserializeXmlObjectWithOtherParts() which was... (diff)
downloadopensim-SC-1b75ec5647afeb9fbdad78f70c0c90a829bba076.zip
opensim-SC-1b75ec5647afeb9fbdad78f70c0c90a829bba076.tar.gz
opensim-SC-1b75ec5647afeb9fbdad78f70c0c90a829bba076.tar.bz2
opensim-SC-1b75ec5647afeb9fbdad78f70c0c90a829bba076.tar.xz
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.
Diffstat (limited to 'OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs')
-rw-r--r--OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
index db46ea8..6debf65 100644
--- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
+++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Framework.Serialization.External
51 /// <param name="xtr"></param> 51 /// <param name="xtr"></param>
52 /// <returns>true on successful, false if there were any processing failures</returns> 52 /// <returns>true on successful, false if there were any processing failures</returns>
53 public static bool ExecuteReadProcessors<NodeType>( 53 public static bool ExecuteReadProcessors<NodeType>(
54 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) 54 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlReader>> processors, XmlReader xtr)
55 { 55 {
56 return ExecuteReadProcessors( 56 return ExecuteReadProcessors(
57 nodeToFill, 57 nodeToFill,
@@ -75,8 +75,8 @@ namespace OpenSim.Framework.Serialization.External
75 /// <returns>true on successful, false if there were any processing failures</returns> 75 /// <returns>true on successful, false if there were any processing failures</returns>
76 public static bool ExecuteReadProcessors<NodeType>( 76 public static bool ExecuteReadProcessors<NodeType>(
77 NodeType nodeToFill, 77 NodeType nodeToFill,
78 Dictionary<string, Action<NodeType, XmlTextReader>> processors, 78 Dictionary<string, Action<NodeType, XmlReader>> processors,
79 XmlTextReader xtr, 79 XmlReader xtr,
80 Action<NodeType, string, Exception> parseExceptionAction) 80 Action<NodeType, string, Exception> parseExceptionAction)
81 { 81 {
82 bool errors = false; 82 bool errors = false;
@@ -88,7 +88,7 @@ namespace OpenSim.Framework.Serialization.External
88 88
89// m_log.DebugFormat("[ExternalRepresentationUtils]: Processing: {0}", nodeName); 89// m_log.DebugFormat("[ExternalRepresentationUtils]: Processing: {0}", nodeName);
90 90
91 Action<NodeType, XmlTextReader> p = null; 91 Action<NodeType, XmlReader> p = null;
92 if (processors.TryGetValue(xtr.Name, out p)) 92 if (processors.TryGetValue(xtr.Name, out p))
93 { 93 {
94// m_log.DebugFormat("[ExternalRepresentationUtils]: Found {0} processor, nodeName); 94// m_log.DebugFormat("[ExternalRepresentationUtils]: Found {0} processor, nodeName);