public void Resolve(FileInfo codelistsConceptsFile, FileInfo dsdFile) 
        {
		    ISdmxObjectRetrievalManager retManager;
		    using (IReadableDataLocation codelistRdl = this._dataLocationFactory.GetReadableDataLocation(codelistsConceptsFile))
		    {
		        retManager = new InMemoryRetrievalManager(codelistRdl, this._structureParsingManager, null);
		    }

		    Console.WriteLine("In memory objects built!!!");

		    IStructureWorkspace workspace;
		    using (IReadableDataLocation dsdRdl = this._dataLocationFactory.GetReadableDataLocation(dsdFile))
		    {
		        ResolutionSettings settings = new ResolutionSettings(ResolveExternalSetting.Resolve, ResolveCrossReferences.ResolveExcludeAgencies);
		        workspace = this._structureParsingManager.ParseStructures(dsdRdl, settings, retManager);
		    }

		    ISdmxObjects sdmxObjects = workspace.GetStructureObjects(true);
			
			ISet<IMaintainableObject> maintainables =  sdmxObjects.GetAllMaintainables();
			foreach (IMaintainableObject m in maintainables) {
				Console.WriteLine(m.Urn);
				Console.WriteLine("{0} - {1}", m.StructureType.StructureType, m.Name);
				Console.WriteLine(" --- ");
			}
		}
        /// <summary>
        /// Parses a structure document OR a Registry document that contains structures.
        /// </summary>
        /// <param name="dataLocation">
        /// The structure location
        /// </param>
        /// <param name="settings">
        /// - addition settings to perform when parsing
        /// </param>
        /// <param name="retrievalManager">
        /// The retrieval manager.
        /// </param>
        /// <returns>
        /// StructureWorkspace - from this structures can be retrieved in any format required
        /// </returns>
        /// <remarks>
        /// Validates the SDMX-ML against the correct schema, also validates the structure according to the SDMX standards,
        ///     using rules which can not be specified by schema.  Uses the supplied settings to perform any extra operations.  If
        ///     resolve external references is set to true, then these structures will also be validated against the Schema and business logic.
        /// </remarks>
        public virtual IStructureWorkspace ParseStructures(
            IReadableDataLocation dataLocation, ResolutionSettings settings, ISdmxObjectRetrievalManager retrievalManager)
        {
            LoggingUtil.Debug(_log, "Parse Structure request, for xml at location: " + dataLocation);

            return this.BuildWorkspace(GetSdmxObjects(dataLocation), settings, retrievalManager);
        }
 /// <summary>
 /// Parses a structure document OR a Registry document that contains structures.
 /// </summary>
 /// <param name="dataLocation">
 /// - the supplied structures
 /// </param>
 /// <returns>
 /// StructureWorkspace - from this structures can be retrieved in any format required
 /// </returns>
 /// <remarks>
 /// Validates the SDMX-ML against the correct schema, also validates the structure according to the SDMX standards,
 ///     using rules which can not be specified by schema.
 ///     Uses the default parsing settings, which is to not validate cross references, and therefore no <c>SdmxBeanRetrievalManager</c> is
 ///     required.
 /// </remarks>
 public virtual IStructureWorkspace ParseStructures(IReadableDataLocation dataLocation)
 {
     var settings = new ResolutionSettings(
         ResolveExternalSetting.DoNotResolve, ResolveCrossReferences.DoNotResolve);
     return this.ParseStructures(dataLocation, settings, null);
 }
        /// <summary>
        /// Build workspace.
        /// </summary>
        /// <param name="sdmxObjects">
        /// The input SDMX objects.
        /// </param>
        /// <param name="settings">
        /// The settings.
        /// </param>
        /// <param name="retrievalManager">
        /// The retrieval manager.
        /// </param>
        /// <returns>
        /// The <see cref="IStructureWorkspace"/>.
        /// </returns>
        public virtual IStructureWorkspace BuildWorkspace(
            ISdmxObjects sdmxObjects, ResolutionSettings settings, ISdmxObjectRetrievalManager retrievalManager)
        {
            if (settings.ResolveExternalReferences)
            {
                this._externalReferenceManager.ResolveExternalReferences(
                    sdmxObjects, settings.SubstituteExternal, settings.Lenient);
            }

            return new StructureWorkspace(
                sdmxObjects,
                retrievalManager,
                settings.ResolveCrossReferences,
                settings.ResolveAgencyReferences,
                settings.ResolutionDepth);
        }
        /// <summary>
        /// Parses a structure document OR a Registry document that contains structures.
        /// </summary>
        /// <param name="reader">
        /// The reader.
        /// </param>
        /// <param name="settings">
        /// - addition settings to perform when parsing
        /// </param>
        /// <param name="retrievalManager">
        /// The retrieval manager.
        /// </param>
        /// <returns>
        /// StructureWorkspace - from this structures can be retrieved in any format required
        /// </returns>
        public IStructureWorkspace ParseStructures(ISdmxXmlStream reader, ResolutionSettings settings, ISdmxObjectRetrievalManager retrievalManager)
        {
            if (!reader.HasReader)
            {
                throw new ArgumentException("ISdmxXmlStream doesnt have a Reader", "reader");
            }

            IMutableObjects objects = null;
            switch (reader.MessageType)
            {
                case MessageEnumType.RegistryInterface:
                    IRegistryInfo registryInfo = this._registryReader.Read(reader.Reader);
                    if (registryInfo.HasQueryStructureResponse && registryInfo.QueryStructureResponse.StatusMessage.Status != Status.Error)
                    {
                        objects = registryInfo.QueryStructureResponse.Structure;
                    }

                    break;
                case MessageEnumType.Structure:
                    objects = this._structureReader.Read(reader.Reader);
                    break;
            }

            if (objects == null)
            {
                objects = new MutableObjectsImpl();
            }

            ISdmxObjects immutableBeans = objects.ImmutableObjects;
            return this.BuildWorkspace(immutableBeans, settings, retrievalManager);
        }
        /// <summary>
        /// Parses a structure document OR a Registry document that contains structures.
        /// </summary>
        /// <param name="dataLocation">
        /// The structure location
        /// </param>
        /// <param name="settings">
        /// - addition settings to perform when parsing
        /// </param>
        /// <param name="retrievalManager">
        /// The retrieval manager.
        /// </param>
        /// <returns>
        /// StructureWorkspace - from this structures can be retrieved in any format required
        /// </returns>
        /// <remarks>
        /// Validates the SDMX-ML against the correct schema, also validates the structure according to the SDMX standards,
        ///     using rules which can not be specified by schema.  Uses the supplied settings to perform any extra operations.  If
        ///     resolve external references is set to true, then these structures will also be validated against the Schema and business logic.
        /// </remarks>
        public IStructureWorkspace ParseStructures(IReadableDataLocation dataLocation, ResolutionSettings settings, ISdmxObjectRetrievalManager retrievalManager)
        {
            var xmlStream = dataLocation as ISdmxXmlStream;
            if (xmlStream != null)
            {
                return this.ParseStructures(xmlStream, settings, retrievalManager);
            }

            _log.DebugFormat("Parse Structure request, for xml at location: {0} ", dataLocation);
            MessageEnumType structureType = SdmxMessageUtil.GetMessageType(dataLocation);
            XmlReaderSettings xmlSettings = XMLParser.GetSdmxXmlReaderSettings(SdmxSchemaEnumType.VersionTwo);
            xmlSettings.ValidationEventHandler += OnValidationEventHandler;
            xmlSettings.NameTable = NameTableCache.Instance.NameTable;

            using (Stream inputStream = dataLocation.InputStream)
            using (XmlReader reader = XmlReader.Create(inputStream, xmlSettings))
            {
                xmlStream = new SdmxXmlStream(reader, structureType, SdmxSchemaEnumType.VersionTwo, RegistryMessageEnumType.QueryStructureResponse);
                return this.ParseStructures(xmlStream, settings, retrievalManager);
            }
        }