Example #1
0
        private void SetupArchiveXmlUnits()
        {
            XmlUnits = new List <ArchiveXmlUnit>();

            foreach (KeyValuePair <string, IEnumerable <string> > documentedXmlUnit in Details.DocumentedXmlUnits)
            {
                string xmlFileName = documentedXmlUnit.Key;

                IEnumerable <string> xmlSchemaNames = documentedXmlUnit.Value;

                var archiveXmlFile = new ArchiveXmlFile(WorkingDirectory.Content().WithFile(xmlFileName));

                var archiveXmlSchemas = new List <ArchiveXmlSchema>();

                foreach (string xmlSchemaName in xmlSchemaNames)
                {
                    FileInfo xmlSchemaFile = WorkingDirectory.Content().WithFile(xmlSchemaName);

                    ArchiveXmlSchema archiveXmlSchema = ArchiveXmlSchema.Create(xmlSchemaFile);

                    archiveXmlSchemas.Add(archiveXmlSchema);
                }

                XmlUnits.Add(new ArchiveXmlUnit(archiveXmlFile, archiveXmlSchemas));
            }
        }
Example #2
0
        private ArchiveXmlUnit SetupAddmlXmlUnit()
        {
            FileInfo addmlFileInfo = WorkingDirectory.Content().WithFile(AddmlXmlFileName);

            if (!addmlFileInfo.Exists && ArchiveType == ArchiveType.Noark5)
            {
                addmlFileInfo = WorkingDirectory.Content().WithFile(ArkivuttrekkXmlFileName);
            }

            var archiveXmlFile = new ArchiveXmlFile(addmlFileInfo);

            FileInfo addmlXsdFileInfo = WorkingDirectory.Content().WithFile(AddmlXsdFileName);

            return(new ArchiveXmlUnit(archiveXmlFile, new UserProvidedXmlSchema(addmlXsdFileInfo)));
        }
Example #3
0
 public ArchiveXmlUnit(ArchiveXmlFile file, List <ArchiveXmlSchema> schemas)
 {
     File    = file;
     Schemas = schemas;
 }
Example #4
0
 public ArchiveXmlUnit(ArchiveXmlFile file, ArchiveXmlSchema schema)
     : this(file, new List <ArchiveXmlSchema> {
     schema
 })
 {
 }
 public UserProvidedXmlSchema(FileSystemInfo schemaFile)
 {
     _archiveXmlFile = new ArchiveXmlFile(schemaFile);
 }