Index: Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ConfigurationReader.cs
===================================================================
diff -u -r94587578a17566618ad7b26fc914d8b4d30fb99b -r3d1a79d25b4059b58271f549f62fc48ac1d1a3ec
--- Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ConfigurationReader.cs (.../ConfigurationReader.cs) (revision 94587578a17566618ad7b26fc914d8b4d30fb99b)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Readers/ConfigurationReader.cs (.../ConfigurationReader.cs) (revision 3d1a79d25b4059b58271f549f62fc48ac1d1a3ec)
@@ -51,12 +51,16 @@
/// Creates a new instance of .
///
/// The file path to the XML file.
- /// A string representing an XML Schema Definition (XSD).
+ /// A string representing the main schema definition.
+ /// A containing
+ /// one or more nested schema definitions; the keys should represent unique file names by which
+ /// the schema definitions can be referenced from , the
+ /// values should represent the corresponding schema definition strings.
/// Thrown when:
///
/// - is invalid.
- /// - is null or empty.
- /// - contains an invalid schema definition.
+ /// - is null or empty.
+ /// - contains an invalid schema definition.
///
///
/// Thrown when:
@@ -66,20 +70,20 @@
/// - points to a file that does not pass the schema validation.
///
///
- protected ConfigurationReader(string xmlFilePath, string schemaString)
+ protected ConfigurationReader(string xmlFilePath, string mainSchemaDefinition, IDictionary nestedSchemaDefinitions)
{
IOUtils.ValidateFilePath(xmlFilePath);
- if (string.IsNullOrWhiteSpace(schemaString))
+ if (string.IsNullOrWhiteSpace(mainSchemaDefinition))
{
- throw new ArgumentException(nameof(schemaString));
+ throw new ArgumentException(nameof(mainSchemaDefinition));
}
ValidateFileExists(xmlFilePath);
xmlDocument = LoadDocument(xmlFilePath);
- ValidateToSchema(xmlDocument, schemaString, xmlFilePath);
+ ValidateToSchema(xmlDocument, mainSchemaDefinition, xmlFilePath);
ValidateNotEmpty(xmlDocument, xmlFilePath);
}
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Readers/ConfigurationReaderTest.cs
===================================================================
diff -u -rb9567422d510ed103f94d8b7917db448eb5a363d -r3d1a79d25b4059b58271f549f62fc48ac1d1a3ec
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Readers/ConfigurationReaderTest.cs (.../ConfigurationReaderTest.cs) (revision b9567422d510ed103f94d8b7917db448eb5a363d)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Readers/ConfigurationReaderTest.cs (.../ConfigurationReaderTest.cs) (revision 3d1a79d25b4059b58271f549f62fc48ac1d1a3ec)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using System.Collections.Generic;
using System.IO;
using System.Xml;
using System.Xml.Linq;
@@ -114,7 +115,7 @@
// Assert
var exception = Assert.Throws(call);
- Assert.AreEqual("schemaString", exception.Message);
+ Assert.AreEqual("mainSchemaDefinition", exception.Message);
}
[Test]
@@ -209,8 +210,8 @@
private class TestConfigurationReader : ConfigurationReader
{
- public TestConfigurationReader(string xmlFilePath, string schemaString)
- : base(xmlFilePath, schemaString) {}
+ public TestConfigurationReader(string xmlFilePath, string mainSchemaDefinition)
+ : base(xmlFilePath, mainSchemaDefinition, new Dictionary()) {}
protected override TestReadConfigurationItem ParseCalculationElement(XElement calculationElement)
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs
===================================================================
diff -u -r8a00046f9112833f25944b0f2631c7003f7a1692 -r3d1a79d25b4059b58271f549f62fc48ac1d1a3ec
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs (.../PipingConfigurationReader.cs) (revision 8a00046f9112833f25944b0f2631c7003f7a1692)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs (.../PipingConfigurationReader.cs) (revision 3d1a79d25b4059b58271f549f62fc48ac1d1a3ec)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
@@ -28,6 +29,7 @@
using Ringtoets.Common.IO.Schema;
using Ringtoets.Piping.IO.Properties;
using Ringtoets.Piping.IO.Schema;
+using RingtoetsCommonIOResources = Ringtoets.Common.IO.Properties.Resources;
namespace Ringtoets.Piping.IO.Readers
{
@@ -50,7 +52,17 @@
///
///
internal PipingConfigurationReader(string xmlFilePath)
- : base(xmlFilePath, Resources.PipingConfiguratieSchema) {}
+ : base(xmlFilePath,
+ Resources.PipingConfiguratieSchema,
+ new Dictionary
+ {
+ {
+ "StochastSchema.xsd", RingtoetsCommonIOResources.StochastSchema
+ },
+ {
+ "HrLocatieSchema.xsd", RingtoetsCommonIOResources.HrLocatieSchema
+ }
+ }) {}
protected override ReadPipingCalculation ParseCalculationElement(XElement calculationElement)
{