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 | |
parent | don't be bad Jenkins.. (diff) | |
download | opensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.zip opensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.gz opensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.bz2 opensim-SC-89a690c11f8c7b6bbe0b6339e79a64d1ae428aec.tar.xz |
a few more xml things
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization')
3 files changed, 32 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index a93782e..c3bc4a0 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | |||
@@ -133,6 +133,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
133 | { | 133 | { |
134 | using (XmlTextReader reader = new XmlTextReader(sr)) | 134 | using (XmlTextReader reader = new XmlTextReader(sr)) |
135 | { | 135 | { |
136 | reader.DtdProcessing = DtdProcessing.Prohibit; | ||
137 | reader.XmlResolver = null; | ||
138 | |||
136 | reader.MoveToContent(); // skip possible xml declaration | 139 | reader.MoveToContent(); // skip possible xml declaration |
137 | 140 | ||
138 | if (reader.Name != "CoalescedObject") | 141 | if (reader.Name != "CoalescedObject") |
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"); |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index 34fdb6d..977dd73 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs | |||
@@ -49,14 +49,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
49 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) | 49 | public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) |
50 | { | 50 | { |
51 | XmlDocument doc = new XmlDocument(); | 51 | XmlDocument doc = new XmlDocument(); |
52 | doc.XmlResolver=null; | ||
52 | XmlNode rootNode; | 53 | XmlNode rootNode; |
53 | 54 | ||
54 | if (fileName.StartsWith("http:") || File.Exists(fileName)) | 55 | if (fileName.StartsWith("http:") || File.Exists(fileName)) |
55 | { | 56 | { |
56 | XmlTextReader reader = new XmlTextReader(fileName); | 57 | using(XmlTextReader reader = new XmlTextReader(fileName)) |
57 | reader.WhitespaceHandling = WhitespaceHandling.None; | 58 | { |
58 | doc.Load(reader); | 59 | reader.WhitespaceHandling = WhitespaceHandling.None; |
59 | reader.Close(); | 60 | reader.DtdProcessing = DtdProcessing.Prohibit; |
61 | reader.XmlResolver = null; | ||
62 | |||
63 | doc.Load(reader); | ||
64 | } | ||
60 | rootNode = doc.FirstChild; | 65 | rootNode = doc.FirstChild; |
61 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) | 66 | foreach (XmlNode aPrimNode in rootNode.ChildNodes) |
62 | { | 67 | { |