diff options
author | UbitUmarov | 2018-01-05 12:24:07 +0000 |
---|---|---|
committer | UbitUmarov | 2018-01-05 12:24:07 +0000 |
commit | 89a690c11f8c7b6bbe0b6339e79a64d1ae428aec (patch) | |
tree | eb039c92222bf22359a20ecb5294b8ab1b2a38eb /OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |
parent | don't be bad Jenkins.. (diff) | |
download | opensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.zip opensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.gz opensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.bz2 opensim-SC_OLD-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.xz |
a few more xml things
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 948c345..a2d512a 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
63 | String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData); | 63 | String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData); |
64 | using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null)) | 64 | using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null)) |
65 | { | 65 | { |
66 | using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment })) | 66 | using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null })) |
67 | { | 67 | { |
68 | try | 68 | try |
69 | { | 69 | { |
@@ -267,18 +267,29 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
267 | return null; | 267 | return null; |
268 | } | 268 | } |
269 | 269 | ||
270 | StringReader sr = new StringReader(parts[0].OuterXml); | 270 | SceneObjectGroup sceneObject; |
271 | XmlTextReader reader = new XmlTextReader(sr); | 271 | using(StringReader sr = new StringReader(parts[0].OuterXml)) |
272 | SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader)); | 272 | { |
273 | reader.Close(); | 273 | using(XmlTextReader reader = new XmlTextReader(sr)) |
274 | sr.Close(); | 274 | { |
275 | reader.DtdProcessing = DtdProcessing.Prohibit; | ||
276 | reader.XmlResolver = null; | ||
277 | |||
278 | sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader)); | ||
279 | } | ||
280 | } | ||
275 | 281 | ||
276 | // Then deal with the rest | 282 | // Then deal with the rest |
283 | SceneObjectPart part; | ||
277 | for (int i = 1; i < parts.Count; i++) | 284 | for (int i = 1; i < parts.Count; i++) |
278 | { | 285 | { |
279 | sr = new StringReader(parts[i].OuterXml); | 286 | using(StringReader sr = new StringReader(parts[i].OuterXml)) |
280 | reader = new XmlTextReader(sr); | 287 | { |
281 | SceneObjectPart part = SceneObjectPart.FromXml(reader); | 288 | using(XmlTextReader reader = new XmlTextReader(sr)) |
289 | { | ||
290 | part = SceneObjectPart.FromXml(reader); | ||
291 | } | ||
292 | } | ||
282 | 293 | ||
283 | int originalLinkNum = part.LinkNum; | 294 | int originalLinkNum = part.LinkNum; |
284 | 295 | ||
@@ -289,8 +300,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
289 | if (originalLinkNum != 0) | 300 | if (originalLinkNum != 0) |
290 | part.LinkNum = originalLinkNum; | 301 | part.LinkNum = originalLinkNum; |
291 | 302 | ||
292 | reader.Close(); | ||
293 | sr.Close(); | ||
294 | } | 303 | } |
295 | 304 | ||
296 | XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); | 305 | XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); |