Adrichem.Serialization.Ameff 1.1.1

Serialize and deserialize ArchiMate Model Exchange File Format files.

Install-Package Adrichem.Serialization.Ameff -Version 1.1.1
dotnet add package Adrichem.Serialization.Ameff --version 1.1.1
<PackageReference Include="Adrichem.Serialization.Ameff" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Adrichem.Serialization.Ameff --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

AmeffSerializer

Serialize and deserialize ArchiMate Model Exchange File Format files (AMEFF). Supports V2.1 and V3.0.

Deserialization example

using Adrichem.Serialization.Ameff.V3

void Deserialize()
{
	string file = @"C:\temp\ArchiSurance V3.xml";
	ModelType MyAmeff;

	XmlSchemaSet Schemas = new XmlSchemaSet();
	Schemas.Add(null, "http://www.opengroup.org/xsd/archimate/3.0/archimate3_Diagram.xsd");
	Schemas.Add("http://purl.org/dc/elements/1.1/", "http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd");

	var MyXmlReaderSettings = new XmlReaderSettings
	{
		Schemas = Schemas,
		ValidationType = ValidationType.Schema,
		ValidationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints |
						  XmlSchemaValidationFlags.ReportValidationWarnings
	};

	using (var Reader = new StreamReader(file))
	{
		using (var XmlRdr = XmlReader.Create(Reader, MyXmlReaderSettings))
		{
			MyAmeff = new XmlSerializer(typeof(ModelType))
				.Deserialize(XmlRdr)
				as ModelType;

			MyAmeff
				.views
				.diagrams
				.Select(d => d.name.FirstOrDefault())
				.Dump()
			;
		}
	}
}

AmeffSerializer

Serialize and deserialize ArchiMate Model Exchange File Format files (AMEFF). Supports V2.1 and V3.0.

Deserialization example

using Adrichem.Serialization.Ameff.V3

void Deserialize()
{
	string file = @"C:\temp\ArchiSurance V3.xml";
	ModelType MyAmeff;

	XmlSchemaSet Schemas = new XmlSchemaSet();
	Schemas.Add(null, "http://www.opengroup.org/xsd/archimate/3.0/archimate3_Diagram.xsd");
	Schemas.Add("http://purl.org/dc/elements/1.1/", "http://dublincore.org/schemas/xmls/qdc/2008/02/11/dc.xsd");

	var MyXmlReaderSettings = new XmlReaderSettings
	{
		Schemas = Schemas,
		ValidationType = ValidationType.Schema,
		ValidationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints |
						  XmlSchemaValidationFlags.ReportValidationWarnings
	};

	using (var Reader = new StreamReader(file))
	{
		using (var XmlRdr = XmlReader.Create(Reader, MyXmlReaderSettings))
		{
			MyAmeff = new XmlSerializer(typeof(ModelType))
				.Deserialize(XmlRdr)
				as ModelType;

			MyAmeff
				.views
				.diagrams
				.Select(d => d.name.FirstOrDefault())
				.Dump()
			;
		}
	}
}

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.1 147 11/21/2018
1.1.0 128 11/20/2018
1.0.0 130 11/19/2018